In Python, the term monkey patch refers to dynamic (or run-time) modifications of a class or module. In Python, we can actually change the behavior of code at run-time.
We use above module (monk) in below code and change behavior of func() at run-time by assigning different value.
Output :monkey_f() is being called
- Python | Unit Test Objects Patching | Set-1
- Python | Unit Test Objects Patching | Set-2
- Dynamic Attributes in Python
- Implementation of Dynamic Array in Python
- Python | Implementing Dynamic programming using Dictionary
- Type Systems:Dynamic Typing, Static Typing & Duck Typing
- Python - Read blob object in python using wand library
- Python | Merge Python key values to list
- Python | Convert list to Python array
- Important differences between Python 2.x and Python 3.x with examples
- twitter-text-python (ttp) module - Python
- MySQL-Connector-Python module in Python
- Python | Index of Non-Zero elements in Python list
- Python | PRAW - Python Reddit API Wrapper
- Reading Python File-Like Objects from C | Python
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- Python | Visualizing O(n) using Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.