What is Monkey patching in Python ? give a example .
Monkey Patching in Python
800
19-Jun-2018
Prakash nidhi Verma
19-Jun-2018Monkey patching :
A dynamic modification of class module patch at run time in python this called monkey patching term.
example:
We can then run the monkey-patch testing like this:
The output will be as below:
in above example some changes in the behavior of f() in My Class using the function. monkey_f(), outside of the module m.