Questions tagged [monkeypatching]

Dynamically modifying run-time behavior by replacing program elements with new program elements

Monkeypatching, in late-bound languages, refers to modifying run-time behavior by replacing program elements with new program elements.

Examples include replacing a method on a class with a new function, or patching a member of a class.

The term may have a pejorative connotation, as the technique is usually used on third-party code.

For more discussion, see "Monkeypatching for Humans" on Coding Horror.

949 questions
-2
votes
1 answer

Typescript monkey patching doesn't work for String

I create a new interface for String to add some utility methods using the technique of Monkey-patching. interface String { toCamelCase(): string; } String.prototype.toCamelCase = function (): string { return this.replace(/[^a-z ]/gi,…
-3
votes
1 answer

Hack python code

I always heard that python was a language that was friendly to monkey patching... well now i need to monkey patch and know not what to do. I specifically need to disable the 'raising' of a parsing exception to see if a iso parsing library behaves.…
i30817
  • 1,356
  • 2
  • 13
  • 26
-3
votes
1 answer

calling method that was undefined in ruby

using external API that has defined as special class where almost all standard methods are undefined to use for building xml. Where #method_missing is responsible to generate elements based on the missing method name called over the…
akostadinov
  • 17,364
  • 6
  • 77
  • 85
-4
votes
1 answer

Web frameworks without monkey patching?

Web frameworks such as Django and Rails rely on monkey patching to enable support for plugins. Are there web frameworks, using Python or Ruby, that support plugins without having to resort to monkey patching? And how would it be possible to…
user782220
  • 10,677
  • 21
  • 72
  • 135
1 2 3
63
64