[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library (original) (raw)
Ethan Furman ethan at stoneleaf.us
Sun Apr 28 02:10:24 CEST 2013
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/27/2013 04:17 PM, Ethan Furman wrote:
On 04/27/2013 04:07 PM, Philip Jenvey wrote:
class Planet(Enum, values='MERCURY VENUS EARTH'): """Planets of the Solar System""" I must be too, 'cause I really like that suggestion. Works easily, simple metaclass (or simple addition to current metaclass). Very nice.
Having said that, what does it look like for a longer enum?
class Planet( Enum, names=''' MERCURY VENUS EARTH MARS SATURN JUPITER URANUS PLUTO ''', ): '''Planets of the Solar System'''
Not sure I like that. Ah well.
--
Ethan
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]