On Nov 8, 2007 5:25 PM, Simon King <[EMAIL PROTECTED]> wrote: > Dear William, > > On Nov 8, 5:36 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > > By an extension class I assume you mean a class you defined using Cython? > > Yes. > > > Type dumps? for the docs on dumps. > > I even did dumps?? and found cPickle mentioned in the code. > But it didn't tell me much, because... > > > In general you might want to read up on Python pickles, since it seems > > perhaps you haven't already done so. Check out: > > http://docs.python.org/lib/module-pickle.html > > to get started. > > ... i was missing such source of information. > > Thank you very much!
Make sure you look at some examples of how __reduce__ is used by various sage extension classes (do search_src('__reduce__')). It took me quite a long time and a lot of experimentation to get from what the Python docs say to understanding how to actually use pickle in the context of extension classes. E.g., one key thing is that you have to use cPickle.dumps with one of the *NON* default pickling protocols or pickling Cython extensions won't work (at least, that was true 2 years ago.) Ask if you get really stuck. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---