c enum - how to do this in python?

Alex Martelli aleax at aleax.it
Fri Feb 21 17:21:13 EST 2003


sismex01 at hebmex.com wrote:
   ...
> Do what?
> 
> Have a certain number of enumerated constants?
> 
> M0 = 0
> M1 = 1
> M2 = 2
> ...
> MCOUNT = n

or more concisely and idiomatically:

M0, M1, M2, MCOUNT = range(4)


Alex





More information about the Python-list mailing list