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
r/lib/python2.5/pickle.py", line 306, in save rv = reduce(self.proto) File "/usr/lib/python2.5/copy_reg.py", line 69, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle instancemethod objects I know that inst

Re: can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
> Here's a thought: comment out every attribute in your class, and then try > pickling it. If it succeeds, uncomment just *one* attribute, and try > pickling again. Repeat until pickling fails. Was trying to avoid that but you motivated me to do so and now I found the probem. In a utility routine

Re: can't pickle instancemethod objects

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 08:39:29 -0700, Jim Lewis wrote: >> I'd suggest that "pop" could be your culprit. ...What is pop? A function or >> an instance method? > > Neither. pop is an instance of a class, like: > class X: >... > pop = X () > > pop surely is the culprit but it has arrays of object

Re: can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
> I'd suggest that "pop" could be your culprit. ...What is pop? A function or > an instance method? Neither. pop is an instance of a class, like: class X: ... pop = X () pop surely is the culprit but it has arrays of objects, etc., and I don't know what to look for. -- http://mail.python.or

Re: can't pickle instancemethod objects

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 07:06:25 -0700, Jim Lewis wrote: >> How about you post the complete stack trace of the exception? > > Exception in Tkinter callback > Traceback (most recent call last): > File "C:\program files\python\lib\lib-tk\Tkinter.py", line 1345, in > __call__ > return self.func(*a

Re: can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
e_dict self._batch_setitems(obj.iteritems()) File "C:\program files\python\lib\pickle.py", line 677, in _batch_setitems save(v) File "C:\program files\python\lib\pickle.py", line 313, in save rv = reduce(self.proto) File "C:\program files\python\lib\copy_reg.py", line 69, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle instancemethod objects -- http://mail.python.org/mailman/listinfo/python-list

Re: can't pickle instancemethod objects

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 05:45:27 -0700, Jim Lewis wrote: > Pickling an instance of a class, gives "can't pickle instancemethod > objects". What does this mean? It means you can't pickle instance methods. > How do I find the class method creating the problem? How abou

can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
Pickling an instance of a class, gives "can't pickle instancemethod objects". What does this mean? How do I find the class method creating the problem? -- http://mail.python.org/mailman/listinfo/python-list