Tricks to do "enums"?

Courageous jkraska1 at san.rr.com
Sun May 7 21:27:50 EDT 2000


So, I've been doing module level enums like this:

##  My module

VAL1=0
VAL2=1
VAL3=3

While this works, and gives me great namespace protection
(individuals using my "enum" prefix it with the module name),
I'm wondering if there's any trick that will produce these
without requiring me to renumber them? I'm getting tired
of typing in new numbers for them if I decide to reorder
them or insert elements...



C/



More information about the Python-list mailing list