docstrings for data fields

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Thu May 3 08:51:54 EDT 2012


Hi!

My class Foo exports a constant, accessible as Foo.MAX_VALUE. Now, with
functions I would simply add a docstring explaining the meaning of this,
but how do I do that for a non-function member? Note also that ideally,
this constant wouldn't show up inside instances of the class but only
inside the class itself.

There are decorators for static functions or class functions, similarly
there is one for instance properties but there isn't one for class
properties. Would that be a useful addition?

Uli



More information about the Python-list mailing list