Am I the only one who would love these extentions? - Python3.0proposals (long)
SEE_AT_THE_END at hotmail.com
Thu Nov 13 00:13:02 CET 2003
I like it. Thanks!
"Dave Brueck" <dave at pythonapocrypha.com> wrote in message news:mailman.673.1068658670.702.python-list at python.org...
| > I like some of your suggestions, like enum.
| I wouldn't mind having a standard module include something like this:
| class Enumerate(object):
| def __init__(self, names):
| for number, name in enumerate(names.split()):
| setattr(self, name, number)
| WORK = Enumerate('NONE WRITE READ SENDFILE CONNECT ACCEPT')
| I like it better than C-style enums because it's clear that the element
| comes from a particular enumeration, e.g.:
| workFlags = WORK.WRITE
More information about the Python-list