[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as (original) (raw)

Stephen J. Turnbull stephen at xemacs.org
Tue Feb 26 04:46:20 CET 2013


Ethan Furman writes:

Again:

Repeating yourself doesn't help make the case. It does, however, encourage me to reply.

Definition of ENUMERATE 1 : to ascertain the number of : count 2 : to specify one after another : list

You say you need the value as an integer; when you evaluate, you are neither counting nor listing. Note that in both counting and listing the object of the operation is not an element. It is a set, and set membership is the most important aspect of the elements for that purpose. The values of the elements (including whether they even have a value) is not relevant to either of those operations.

On the other hand, if you are going to access (constant!) values by name, I don't see any reason to restrict the domain to integers. Nor do such named constants need to be members of any set in many cases.



More information about the Python-Dev mailing list