Bruno Desthuilliers a écrit :
> A.T.Hofkamp a écrit :
> 
(snip)

>> # Below is produced with
>> # print '\n'.join(['        self.%s = self.mydict.%s' % (v,v)
>> #                                         for v in dir(dict)])
>> # commented-out functions done by hand
>> #
>>         #self.__class__ = self.mydict.__class__
>>         self.__cmp__ = self.mydict.__cmp__
>>         self.__contains__ = self.mydict.__contains__
> 
> 
> (snip lots of useless code)
> 
> May I suggest that you learn to use __getattr__ and __setattr__ ?-)

Mmmm... Should have tested before posting this. Please ignore this 
remark, looks like __getattr__ is not called for __magic__ methods. Doh :(

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to