Le Mon, 25 Feb 2013 11:37:29 -0500, Barry Warsaw <ba...@python.org> a écrit : > On Feb 25, 2013, at 07:12 AM, Ethan Furman wrote: > > >And if, in those places, the enums were based on ints (or strings), > >would it hurt you? Because in the places where I, as well as many > >others, use enums we *need* the int portion; and having to wrap the > >enum in an int() call is seven extra keystrokes (minor) and a heap > >of visual clutter (major), destroying any value the enum was > >supposed to have. > > Yes, I think enum values inheriting from int (or string) would hurt. > > First, as your question implies, which is it? int or str? Some > people want int some want str. It can't be both, and I don't think > we need two enum types.
I think we do "need" two enum types (as far as some enum mechanism is needed). str is better for most pure-Python uses, but int is necessary for a lot of portability / compatibility requirements. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com