On Wed, 16 Jan 2013 15:42:42 +0100, Florian Lindner wrote: > Hello, > > I have a: > > class C: > def __init__(self): > d = dict_like_object_created_somewhere_else() > > def some_other_methods(self): > pass > > > class C should behave like a it was the dict d.
Then make it a dict: class C(dict): def some_other_methods(self): pass my_dict = C(key="value") # or C({"key": "value"}) print len(my_dict) print my_dict['key'] my_dict.some_other_methods() -- Steven -- http://mail.python.org/mailman/listinfo/python-list