enum 0.4.1 not pickle-firendly

ago xivulon at gmail.com
Wed Jul 19 11:25:57 EDT 2006


I have started using the enum module () , at them moment pickling an
object instance that has an EnumValues assigned to one of its
attributes pickles the full enumeration, this is not efficient. I am
not sure what is the best way around (I do not like the idea of having
to use __getstate__/__setstate__ every  time), but I guess that a
EnumValue should not have a reference to an Enum instance. Maybe a
better approach might be to have Enum as a metaclass so that each
EnumValue only references the particular Enum class.




More information about the Python-list mailing list