Tricks to do "enums"?

Courageous jkraska1 at san.rr.com
Mon May 8 00:16:14 EDT 2000


> I've seen the other two followups, and I think it's the wrong approach
> *unless* you're using variable names to indicate column order in e.g. a
> database.  Generally, you're wanting to test a set of enums, so you
> should use strings in either a list or a dict:

Ouch. That could get to be expensive, if you're repetively evaluating
them. Part of what I'm using them for is some predicate logic in a
simulator which evaluates many possible futures every time cycle.
String comparisons is something I want to categorically avoid.

As for the other posters, thanks again! That's just what I wanted.



C/



More information about the Python-list mailing list