deepcopy chokes with TypeError on dynamically assigned instance method

Nick Coghlan ncoghlan at iinet.net.au
Thu Feb 10 08:50:09 EST 2005


5ÛHH575-UAZWKVVP-7H2H48V3 wrote:
> class Foo(list):
>     "Foo"
> 
>     def __init__(self, l=[]):

Change this too:
   def __init__(self, l=None):
     if l is None: l = []


And see if your problem goes away.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list