Tricks to do "enums"?

Courageous jkraska1 at san.rr.com
Mon May 8 00:39:53 EDT 2000


You shouldn't be if your using them like enums.  Your not even
> doing string comparisons.  Python is byte compiled.  Strings that
> appear in the source are interned.  Comparing two interned
> strings is just a pointer comparison.

Oh, I see what you're saying. So if I compare mymodule.ALPHA
to an attribute thay may or may not be set to mymodle.ALPHA,
I can do an identity-compare. Nifty.

Thanks.


C/



More information about the Python-list mailing list