> There's another option. Consider this paragraph from the Python > library reference: > > ===== > Things are a little cleaner with cPickle, but not by much. To control > what gets unpickled, you can set the unpickler's find_global attribute > to a function or None. If it is None then any attempts to unpickle > instances will raise an UnpicklingError. If it is a function, then it > should accept a module name and a class name, and return the > corresponding class object. It is responsible for looking up the class > and performing any necessary imports, and it may raise an error to > prevent instances of the class from being unpickled. > ===== >
So this is really nice. It will let us deal with moving classes around within sage -- we simply add a find_global function which can do basic remappings in cases where things move. We should definitely add our own find_global somewhere, and use that to let us restructure classes and modules without breaking old pickles. However, we still have the problem of uniqueness -- since this still wants a class that it will instantiate, we'll still end up with non-unique parents. -cc --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---