Pierre Barbier de Reuille wrote: > When you need some symbols in your program, what do you use in Python ? > > For example, an object get a state. This state is more readable if > expressed as a symbols, for example "opened", "closed", "error". > Typically, in C or C++, I would use an enum for that: > enum OBJECT_STATE > { > opened, closed, error > }
OPENED, CLOSED, ERROR = range(3) object.state = OPENED -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Whoever named it necking was a poor judge of anatomy. -- Groucho Marx -- http://mail.python.org/mailman/listinfo/python-list