Popular recipes by asdfsa asdfdsaf http://code.activestate.com/recipes/users/515672/2001-02-23T18:24:19-08:00ActiveState Code RecipesAdd a method to a class instance at runtime (Python)
2001-02-22T17:04:07-08:00asdfsa asdfdsafhttp://code.activestate.com/recipes/users/515672/http://code.activestate.com/recipes/52192-add-a-method-to-a-class-instance-at-runtime/
<p style="color: grey">
Python
recipe 52192
by <a href="/recipes/users/515672/">asdfsa asdfdsaf</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>This recipe demonstrates the runtime addition of a __str__ method to a class instance. This can sometimes be useful for debugging purposes. It also demonstrates the use of the two special attributes of class instances: '__dict__' and '__class__'.</p>
Howto add a method to an instance at runtime for debugging (Python)
2001-02-23T18:24:19-08:00asdfsa asdfdsafhttp://code.activestate.com/recipes/users/515672/http://code.activestate.com/recipes/52194-howto-add-a-method-to-an-instance-at-runtime-for-d/
<p style="color: grey">
Python
recipe 52194
by <a href="/recipes/users/515672/">asdfsa asdfdsaf</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>This recipe demonstrates the runtime addition of a __str__ method to a class instance. This can sometimes be useful for debugging purposes. It also demonstrates the use of the two special attributes of class instances: '__dict__' and '__class__'.</p>