Top-rated recipes by nicksjacobson http://code.activestate.com/recipes/users/2421749/top/2005-04-21T17:29:19-07:00ActiveState Code RecipesAutomatically set all passed parameters to self (Python)
2005-04-21T17:29:19-07:00nicksjacobsonhttp://code.activestate.com/recipes/users/2421749/http://code.activestate.com/recipes/410665-automatically-set-all-passed-parameters-to-self/
<p style="color: grey">
Python
recipe 410665
by <a href="/recipes/users/2421749/">nicksjacobson</a>
.
</p>
<p>I have found it tedious to, when passing many variables to a class's constructor, assigning them all to self. This is a method to assign them automatically. It works with default arguments as well.</p>