[Python-ideas] PEP XXX - Competitor with PEP 435: Adding an enum type to the Python standard library

Random832 random832 at fastmail.us
Wed Mar 13 03:11:49 CET 2013

On 03/12/2013 09:58 PM, Andrew Barnert wrote:
> Well, you need to be able to get the int value of a set, too. What's the point of being able to do mmap.PROT_READ | mmap.PROT_WRITE if I (or the mmap module) can't turn that into a 3?
No, you'd be able to turn _that_ into a 3. What I'm suggesting is being 
able to pass x = {t.PROT_READ, t.PROT_WRITE} into the mmap module, and 
then it can do int(t(x)) to get 3.

Particularly since I don't really _like_ the a|b syntax for this, for 
some indefinable reason, and would like for passing in actual set 
literals to be the preferred way of doing it.

More information about the Python-ideas mailing list