Persist a class (not an instance)

Kent Johnson kent37 at tds.net
Fri Nov 25 10:44:54 EST 2005


Sybren Stuvel wrote:
> Kent Johnson enlightened us with:
> 
>>Is there a way to persist a class definition (not a class instance,
>>the actual class) so it can be restored later?
> 
> 
> From the docs:
> 
> "Similarly, classes are pickled by named reference, so the same
> restrictions in the unpickling environment apply. Note that none of
> the class's code or data is pickled [...]"

OK that confirms that pickle won't work. Is there another approach that will?

Kent



More information about the Python-list mailing list