On 1/25/07, Collin Winter email@example.com wrote:
How will e.g. classes be simplified? Can I simplify a dictionary with function objects for values?
well, pickle just saves them as a global name (modulename.classname). so types would generally just return themselves as primitives, and let the actual simplifier do the trick.
it may choose to save the type's dict, or just a global name. that's up to the serializer-dependent simplifier.
it's good you mentioned that, because it reminded me of something i forgot. for instance, code objects will be serialized by value, so you could actually pickle functions and classes.
this means pyc files could become just a pickle of the module, i.e.: import foo pickle.dump(foo, open("foo.pyc", "w"))
but again, that's up to the serializer. an enhanced pickle could do that.