Re: pickle error: can't pickle instancemethod objects

2008-05-23 Thread Michele Simionato
On May 23, 10:12 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Michele Simionato wrote: > > Can somebody explain what's happening with the following script? > >     def __gestate__(self): # should skip the bound methods attributes > > Must be __getstate__ ;) > > Peter Aaargh!!! I spent a couple of

Re: pickle error: can't pickle instancemethod objects

2008-05-23 Thread Peter Otten
Michele Simionato wrote: > Can somebody explain what's happening with the following script? > def __gestate__(self): # should skip the bound methods attributes Must be __getstate__ ;) Peter -- http://mail.python.org/mailman/listinfo/python-list

pickle error: can't pickle instancemethod objects

2008-05-23 Thread Michele Simionato
Can somebody explain what's happening with the following script? $ echo example.py import pickle class Example(object): def __init__(self, obj, registry): self._obj = obj self._registry = registry for name, func in self._registry.iteritems(): setattr(self,