Carl Banks <pavlovevide...@gmail.com> writes: > On Jan 21, 1:51 pm, Martin Drautzburg <martin.drautzb...@web.de> > wrote: > > (2) Using enum's was suggested. That is good to know, but again it > > is just a way to define constants in the caller's namespace. > > It'll at least corral the symbols you want.
It also satisfies the strongly-expressed demand you had for these constants to *not* be strings. It keeps the semantic meaning of these constants very distinct, and greatly reduces the possibility of an object accidentally having the same value as one of these constants. -- \ “Roll dice!” “Why?” “Shut up! I don't need your fucking | `\ *input*, I need you to roll dice!” —Luke Crane, demonstrating | _o__) his refined approach to play testing, 2009 | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list