PEP 354: Enumerations in Python

Paul Rubin http
Wed Mar 1 23:48:56 EST 2006


Ben Finney <bignose+hates-spam at benfinney.id.au> writes:
> > I don't know about this.  It makes athlon64_instructions a
> > completely separate enum from pentium_instructions.  It could be
> > that athlon64_instructions.add should be the same as
> > pentium_instructions.add .
> 
> If you want the members of two distinct collections to have a
> meaningful relationship, you don't want enumerations. The basic
> promise of the specified enumeration interface is that every member of
> an enumeration is a unique value.

The premise is that they're not necessarily distinct (disjoint)
collections; one of them has been explicitly created as a superset of
the other.



More information about the Python-list mailing list