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

2013年2月25日 07:24:44 -0800

On Tue, Feb 26, 2013 at 12:53 AM, Skip Montanaro <[email protected]> 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 | [email protected] | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to