Popular recipes by Atsushi Odagiri http://code.activestate.com/recipes/users/1006051/2003-02-24T15:31:44-08:00ActiveState Code RecipesAutomatic Delegation (Python)
2003-02-24T15:31:44-08:00Atsushi Odagirihttp://code.activestate.com/recipes/users/1006051/http://code.activestate.com/recipes/184275-automatic-delegation/
<p style="color: grey">
Python
recipe 184275
by <a href="/recipes/users/1006051/">Atsushi Odagiri</a>
.
Revision 2.
</p>
<p>Delegation gives us monotonous codings.
But, special method '__getattr__' is called when a certain object does not have the called method.</p>
<p>This recipe solve the tiresome coding.
The object should call delegated object's method by argument 'name'.</p>