Monkey patch

In computer programming, monkey patching is a technique used to dynamically update the behavior of a piece of code at run-time.

The word guerrilla, nearly homophonous with gorilla, became monkey, possibly to make the patch sound less intimidating.

In Ruby,[2] Python,[3] and many other dynamic programming languages, the term monkey patch only refers to dynamic modifications of a class or module at runtime, motivated by the intent to patch existing third-party code as a workaround to a bug or feature which does not act as desired.

For example, in Zope and Plone, security patches are often delivered using dynamic class modification, but they are called hot fixes.

[citation needed] Monkey patching is used to: Malicious, incompetently written, and/or poorly documented monkey patches can lead to problems: The following Python example monkey-patches the value of Pi from the standard Python math library to make it compliant with the Indiana Pi Bill.