Improving __init__ where args are assigned directly to members
<p>I'm finding myself writing a lot of classes with constructors like this:</p>

<pre><code>class MyClass(object):
    def __init__(self, foo, bar, foobar=1, anotherfoo=None):
        self.foo = foo
        self.bar = bar
        self.foobar = foobar
        self.anotherfoo = anotherfoo
</code></pre>

<p>Is this a bad code smell?  Does Python offer a more elegant way of handling this?</p>

<p>My classes and even some of the constructors are more than just what I've shown, but I usually have a list of args passed to the constructor which just end up being assigned to similarly named members.  I made some of the arguments optional to point out the problem with doing something like:</p>

<pre><code>class MyClass(object):
    def __init__(self, arg_dict):
        self.__dict__ = arg_dict
</code></pre>
