adopt an enum type for the standard library?
23 Jan
2008
23 Jan
'08
8:59 a.m.
AFAIK if you want enumerations you must either create your own, or use a third party module, or use namedtuple: Files = collections.namedtuple("Files", "minimum maximum")(1, 200) ... x = Files.minimum Using: MINIMUM, MAXIMUM = 1, 200 is often inconvenient, since you might have several different ones. Of course you could do: MIN_FILES = 1 MIN_DIRS = 0 Personally, I like enums and consider them to be a fundamental, but I don't like the above approaches. There is an enum module in PyPI http://pypi.python.org/pypi/enum/ and there are several versions in the Python Cookbook. Wouldn't one of these be worth adopting for the standard library? -- Mark Summerfield, Qtrac Ltd., www.qtrac.eu
5830
Age (days ago)
5910
Last active (days ago)
14 comments
10 participants
participants (10)
-
Aaron Brady
-
Christian Heimes
-
Eduardo O. Padoan
-
Guilherme Polo
-
Jonathan Marshall
-
Mark Summerfield
-
Mathias Panzenböck
-
Raymond Hettinger
-
Tal Einat
-
wrobell