[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
Guido van Rossum
guido at python.org
Mon Apr 22 04:58:53 CEST 2013
On Sun, Apr 21, 2013 at 5:55 PM, Tim Delaney
<timothy.c.delaney at gmail.com> wrote:
> On 22 April 2013 10:31, Barry Warsaw <barry at python.org> wrote:
>> On Apr 22, 2013, at 09:31 AM, Tim Delaney wrote:
>> >I'm fine with iteration order being by sorted name by default, so long as
>> >it's easily overrideable by enum subclasses or metaclasses e.g. an
>> > IntEnum
>> >should probably iterate in value order.
>> It does</timemachine>. :)
> I knew it *did*, but wasn't sure if with the current discussion it was going
> to continue to do so.
In any case I think it would be odd if IntEnum used a different policy
than Enum. That would be a disturbing difference in behavior between
two otherwise rather similar classes.
> 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 :)
I'm convinced. I also think that 2/3 compatibility is not as important
as getting it right for the foreseeable future.
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev