Le Mon, 25 Feb 2013 11:37:29 -0500, Barry Warsaw <barry at 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4