DEV Community

Monkeying Around with Python: A Guide to Monkey Patching

Karishma Shukla on February 19, 2024

What is Monkey Patching in Python? Imagine modifying a car's engine while it's running. Monkey patching works similarly, allowing you ...
Collapse
 
patrickcodes profile image
Nishant

I learnt something new. 👏

Collapse
 
karishmashukla profile image
Karishma Shukla

Glad to know :)

Collapse
 
ranudar profile image
Christian Epple

Great article, thanks a lot.
Small question though: would length * width not be correct usually, for example with rectangles?

Your example could work with the circumference of a circle:
circumference = radius * Pi (wrong)

circumference = 2 * radius * Pi (correct)

Did I miss something?
Best regards!

Collapse
 
ninjaprogrammer profile image
SP

Great stuff as usual Karishma.