Am I the only one who would love these extentions? - Python3.0proposals (long)

Georgy Pruss SEE_AT_THE_END at hotmail.com
Wed Nov 12 18:13:02 EST 2003


I like it. Thanks!
G-:

"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
|
| -Dave
|
|






More information about the Python-list mailing list