[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
Ethan Furman
ethan at stoneleaf.us
Fri Apr 26 00:26:43 CEST 2013
On 04/25/2013 03:11 PM, Barry Warsaw wrote:
> On Apr 21, 2013, at 09:12 PM, R. David Murray wrote:
>
>> Regardless of the specific values involved, it is pretty much guaranteed
>> that if anything other than definition order is used we *will* get bug
>> reports/enhancement requests to fix it, on a regular basis. We can choose
>> to live with that, but we should admit that it will will happen :)
>
> What's the definition order here?
>
> >>> Methods = Enum('Methods', {'set': 8, 'get': 15, 'delete': 16})
Whatever random order {}.keys() returns -- and python programmers should be expecting that (or at least smack themselves
for forgetting it ;)
--
~Ethan~
More information about the Python-Dev
mailing list