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

Nick Coghlan ncoghlan at gmail.com
Mon Feb 25 16:22:34 CET 2013


On Tue, Feb 26, 2013 at 12:53 AM, Skip Montanaro <skip at pobox.com> wrote:
>>> If it was just once or twice, sure, but I use them as names for ints,
>>> which means I use them as ints, which means I would have a boat load of
>>> int() calls.
>>
>>
>> Personally I don't see "name for ints" as being the main use case for enums.
>
> Ethan seems to have a use case, even if it is using enums to
> masquerade as true named constants.  Perhaps the correct solution is
> to consider support for true constants in Python.  (I would be
> surprised if there wasn't already at least one rejected or dormant PEP
> regarding that topic.)

I don't think we need true constants - labelled values should suffice
for easier to debug magic numbers.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list