On Jun 07, 2013, at 02:30 PM, PJ Eby wrote:

>I don't know if enums *actually* preserve this invariant, but my
>default expectation of the One Obvious Way would be that enums, being
>uniquely-named objects that know their name and container, should be
>considered global objects in the same fashion as classes and
>functions, *and* that as singletons, they'd also be treated in the
>same way as None, Ellipsis, etc.  That is, there are two independent
>precedents for objects like that preserving "is" upon pickling and
>unpickling.

This is certainly how I thought of them in flufl.enum, and indeed the `is`
test in my own test suite proves that it works.

-Barry
_______________________________________________
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