Talk:Monkey patch
From Wikipedia, the free encyclopedia
How does this compare to Objective-C categories and posing?
I just removed the statement:
In Python a file named __init__.py must exist for a directory to become a Python package. Normally code is not placed in this file, and so provides the best place to hide code when waging war with guerilla patches.
For one, there are MANY examples in the python standard library where the __init.py__ file contains lots of code (e.g. the 'email', 'logging', 'encoding' packages, among many other). For two, monkey-patching can happen on any kind of object, regardless of whether it is part of a package (the only place __init__.py is relevant at all). The determination of *best place* is entirely subjective. And finally, if you're modifying the __init__.py, you're modifiying the package itself, which by definition is not monkey patching. William McVey (talk) 23:01, 30 January 2008 (UTC)