[Python-Dev] Enumeration items: mixed types? (original) (raw)

Tim Delaney timothy.c.delaney at gmail.com
Wed May 1 02:06:17 CEST 2013


On 1 May 2013 02:27, Eli Bendersky <eliben at gmail.com> wrote:

On Mon, Apr 29, 2013 at 5:38 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote: Ethan Furman wrote:

I suppose the other option is to have .value be whatever was assigned (1, 'really big country', and (8273.199, 517) ),

I thought that was the intention all along, and that we'd given up on the idea of auto-assigning integer values (because it would require either new syntax or extremely dark magic). Yes, Guido rejected the auto-numbering syntax a while back. The only case in which auto-numbering occurs (per PEP 435) is the "convenience syntax": Animal = Enum('Animal', 'fox dog cat')

Actually, since Guido has pronounced that definition order will be the default, there's no reason each Enum instance couldn't have an "ordinal" attribute.

Tim Delaney -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130501/643c9ccd/attachment.html>



More information about the Python-Dev mailing list