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

Ethan Furman ethan at stoneleaf.us
Tue Mar 12 01:47:23 CET 2013

On 03/11/2013 05:20 PM, Stephen J. Turnbull wrote:
> Paul Moore writes:
>   > Yes, it is - thanks. I missed the significance of "Sequence" in the
>   > PEP
> Overall the PEP's presentation suffers severely from class-instance
> confusion.  In the *enumeration* Color(red, green, blue), Color.red is
> not an "enumeration", it is an *enumerator* (or element or member).
> Ditto for all the concrete class names.  I'm not sure this really
> matters (I'm the kind of pedant who is enraged by the use of "it's" as
> a possessive), but it bugs me.<wink/>

I would not be sad if you chose to go through and fix those things -- it
seems I lack the necessary vocabulary.  Although I usually get `its` correct.

> In the case of "Sequence", I would assume that the actual behavior is
> equivalent to range() with names.  Based on past discussion of Ethan's
> use case, I suppose that that's not quite accurate.  Rather, I expect
> that Sequence actually addresses the question of using an enumerator
> as an index to a Python sequence (list, etc.)

That's pretty much what I use it for, but it also solves Antoine's use case
of, e.g., http status codes that otherwise act like normal ints.


More information about the Python-ideas mailing list