Popular Python recipes tagged "meta:requires=module"http://code.activestate.com/recipes/langs/python/tags/meta:requires=module/popular/2005-01-19T10:54:34-08:00ActiveState Code RecipesInitReplacement (Python)
2005-01-19T10:54:34-08:00Shannon -jj Behrenshttp://code.activestate.com/recipes/users/2269827/http://code.activestate.com/recipes/363785-initreplacement/
<p style="color: grey">
Python
recipe 363785
by <a href="/recipes/users/2269827/">Shannon -jj Behrens</a>
(<a href="/recipes/tags/oop/">oop</a>).
</p>
<p>Hack a class's __init__ method without subclassing the class
because a) you can't modify the original class and b) you can't modify other
classes already using the first class. This is a gross hack that should only
be used to work around flaws in libraries you have no control over. I've
changed the names to protect the innocent.</p>