Re: How to improve this code?

2009-09-18 Thread Sergey Simonenko
, Sergey Simonenko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclass dynamically

2009-08-18 Thread Sergey Simonenko
( self.base ): def __init__( self, base ): self.base = base Something like that... and then I would do this: foo = MyDerived( MyBase() ) Note I'm using Python 3.1 on Windows. Thanks in advance. -- Kind regards, Sergey Simonenko. -- http://mail.python.org/mailman/listinfo/python-list

Subclassing Python's dict

2009-08-05 Thread Sergey Simonenko
Hi, I subclass builtin 'dict' in my application and experience some problems with it. The whole issue is that I should redefine 'setdefault' and 'update' methods after redefining '__setitem__' or/and '__delitem__', otherwise 'update' and 'setdefault' ignore redefined '__setitem__' and use