Tricks to do "enums"?
Neil Schemenauer
nascheme at enme.ucalgary.ca
Mon May 8 01:19:33 EDT 2000
Courageous <jkraska1 at san.rr.com> wrote:
>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.
"==" works just as well. Python smart enough to try a pointer
compare first. The code path is almost the same so I doubt there
would be much speed gained by using "is".
Neil
--
"More computing sins are committed in the name of efficiency
(without necessarily achieving it) than for any other single
reason, including blind stupidity." -- W.A. Wulf
More information about the Python-list
mailing list