[Python-ideas] adopt an enum type for the standard library?
wrobell
wrobell at pld-linux.org
Thu Jan 24 02:21:22 CET 2008
On Wed, Jan 23, 2008 at 04:36:26PM +0200, Tal Einat wrote:
[...]
> What I usually do in Python is this:
>
> ERROR, OK, ALSO_OK = range(-1, -1 + 3)
>
> Start and stop values, as well step sizes other than one, are easily
> achieved. Skipping values is done like this:
>
> ERROR, OK, ALSO_OK, SOMEOTHER, LAST = range(-1, -1 + 3) + range(1000, 1000 + 2)
are you able to decode that at 4am? :)
[...]
regards,
wrobell <wrobell at pld-linux.org>
More information about the Python-ideas
mailing list