Ian Bicking: the old part of his blog

Re: Reducing boilerplate code in __init__

>>> class Foo(object):
...     def __init__(self, a, b=10):
...             for name, value in locals().items():
...                     setattr(self, name, value)
...
>>> foo = Foo(1)
>>> foo.__dict__
{'a': 1, 'self': <__main__.Foo object at 0xb7d7396c>, 'b': 10}
Comment on Reducing boilerplate code in __init__
by EduardoPadoan