class level properties

Peter Otten __peter__ at web.de
Sun Apr 13 03:17:35 EDT 2008


Charles D Hixson wrote:

> I want a hundred or so read-only variables, and I'm not sure the best
> way to achieve it.

What do you really want to do? I recommend that you forget about bondage and
rely upon displine:

class Test(object):
    """Never change an attribute with an uppercase name."""
    SIMPLE = "simple example working"

Now that was easy...

Peter




More information about the Python-list mailing list