Re: [Tutor] problem with unpickling an object

2006-06-05 Thread Yi Qiang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yi Qiang wrote, On 06/05/2006 01:22 PM: > Kent Johnson wrote, On 06/05/2006 07:25 AM: >>> No, the find_global() hook is for cPickle. See the next-to-last >>> paragraph on this page: >>> http://docs.python.org/lib/pickle-sub.html > Sorry, I don't follo

Re: [Tutor] problem with unpickling an object

2006-06-05 Thread Yi Qiang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kent Johnson wrote, On 06/05/2006 07:25 AM: > No, the find_global() hook is for cPickle. See the next-to-last > paragraph on this page: > http://docs.python.org/lib/pickle-sub.html Sorry, I don't follow. How does one get access to the find_global att

Re: [Tutor] problem with unpickling an object

2006-06-05 Thread Kent Johnson
Yi Qiang wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Kent Johnson wrote, On 06/05/2006 03:12 AM: >> From a quick read of the docs, it looks like you should set the >> unpickler's find_global attribute to a function you define. This >> function can first attempt to load the desi

Re: [Tutor] problem with unpickling an object

2006-06-05 Thread Yi Qiang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kent Johnson wrote, On 06/05/2006 03:12 AM: > From a quick read of the docs, it looks like you should set the > unpickler's find_global attribute to a function you define. This > function can first attempt to load the desired class (see > pickle.fi

Re: [Tutor] problem with unpickling an object

2006-06-05 Thread Kent Johnson
From a quick read of the docs, it looks like you should set the unpickler's find_global attribute to a function you define. This function can first attempt to load the desired class (see pickle.find_class() for an example). If the load fails, then return a placeholder class that you define. T

[Tutor] problem with unpickling an object

2006-06-04 Thread Yi Qiang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, I am pickling a dictionary that has as one of it's values an object I create on the fly. When I try to unpickle that object, cPickle attempts to recreate that object but of course that module is not present anymore. How can I just make it sk