Kent Johnson <[EMAIL PROTECTED]> wrote: > Is there a way to persist a class definition (not a class instance, the > actual class) so it can be restored later? A naive approach using pickle > doesn't work:
You can use copy_reg to customize pickling behavior. In this case, you'd need a custom metaclass to use as the type for your "picklable classes". Moreover, if the class has attributes that you also want to pickle, such as methods or properties, you'll have to arrange for custom pickling of *them*, too. So, yes, there are ways, but not simple ones. Alex -- http://mail.python.org/mailman/listinfo/python-list