PEP 354: Enumerations in Python
Peter Maas
peter.maas at somewhere.com
Wed Mar 1 17:30:25 EST 2006
Paul Rubin schrieb:
>> But if you have a good usage case for an empty enum, please feel free
>> to tell us.
>
> Do you have a good usage case for the number
> 647574296340241173406516439806634217274336603815968998799147348150763731 ?
Yes, it could be the value of my property in any currency :) But your
argument is wrong. There's no logical or even aesthetical reason to
have empty enums. An empty set is an instance of the set type like 0
or your big number are instances of the integer type and are neccessary
to make some operations complete. But an empty enum is a *type* without
values, therefore a type that cannot be instantiated i.e. a useless
type.
I don't like Python enums at all. It is kind of "I want to have that
C++ thing, too". In Python enums can be emulated so there's no need
to have syntactical support for them.
Peter Maas, Aachen
More information about the Python-list
mailing list