Paul McGuire wrote in news:[EMAIL PROTECTED] in comp.lang.python:
>>> opAssoc = Constants(object) >>> opAssoc.RIGHT = 0 >>> opAssoc.LEFT = 1 >> This is nice, but you can cut down on some of the cruft: >> Constants.LEFT = 1 > One man's cruft is another man's clarity. :-) > The reason I used instances > instead of just the Constants class was so that I could define a > little more descriptive context for the constants, Sorry I don't know what you mean here, could I have an example ? > rather than simply > a shortcut for importing lots and lots of constant definitions. I > expect I will want to define some more constants for other parts of > pyparsing, and the instance scoping helps organize them, that's all. Again I'm struggling to see how using an instance is any different from just using the class ? Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list