On Nov 23, 2010, at 11:52 AM, P.J. Eby wrote:

>This reminds me: a stdlib enum should support proper pickling and copying;
>i.e.:
>
>    assert SomeEnum.anEnum is pickle.loads(pickle.dumps(SomeEnum.anEnum))
>
>This could probably be implemented by adding something like:
>
>    def __reduce__(self):
>        return getattr, (self._class, self._enumname)
>
>in the EnumValue class.

Excellent idea, thanks.  Added to flufl.enum in r38.  However, only enums
created with the class syntax can be pickled though.

Cheers,
-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to