On 04/27/2013 04:07 PM, Philip Jenvey wrote:
Call me crazy, but might I suggest:
class Planet(Enum, values='MERCURY VENUS EARTH'):
"""Planets of the Solar System"""
Okay, you're crazy! ;)
I must be too, 'cause I really like that suggestion. Works easily, simple metaclass (or simple addition to current
metaclass).
Very nice.
--
~Ethan~
_______________________________________________
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