Tricks to do "enums"?
jkraska1 at san.rr.com
Mon May 8 09:52:48 CEST 2000
> >>> a = "a"
> >>> eval("'a' is a")
So, it would appear that the limit would be uneval'd
strings, potentially taken from the user or a file. I
suspect that even if you can't eval strings, this is
probably one of the reasons why the intern() function
exists. You can grab a string from a non constant
external source, and attempt to give it identity, based
on previously existing known string identities. Very
This isn't something c or c++ can do for you, either.
More information about the Python-list