Re: pickle and instancemethod objects

2006-09-13 Thread Steven Bethard
Martin v. Löwis wrote: > Steven Bethard schrieb: >> Does this approach seem sound? Am I going to run into some weird >> problems doing it this way? > > It's good, but I think rebuilding the object through > new.instancemethod should be even better. > > py> class A: > ... def f(self):print "A"

Re: pickle and instancemethod objects

2006-09-13 Thread Martin v. Löwis
Steven Bethard schrieb: > Does this approach seem sound? Am I going to run into some weird > problems doing it this way? It's good, but I think rebuilding the object through new.instancemethod should be even better. py> class A: ... def f(self):print "A" ... py> class B(A): ... def f(self):p

pickle and instancemethod objects

2006-09-13 Thread Steven Bethard
I'd like to be able to pickle instancemethod objects mainly because I want to be able to delay a call like ``foo(spam, badger)`` by dumping ``foo``, ``spam`` and ``badger`` to disk and loading them again later. Sometimes the callable ``foo`` is actually a bound method, e.g. ``bar.baz``, but in