You can define a property on the metaclass for this effect.

On Thu, Aug 20, 2015 at 2:54 AM, Thomas Güttler <guettliml@thomas-guettler.de> wrote:
I think it would be great to have properties for classes in Python2 and Python3

There are some "patterns" to get this working:

  http://stackoverflow.com/questions/5189699/how-can-i-make-a-class-property-in-python

  http://stackoverflow.com/questions/128573/using-property-on-classmethods

... but an official solution would be more "zen of python".

Do you think properties for classes would be useful?

If it works for classes, then it could be used for modules, too?

Regards,
  Thomas Güttler

PS: my first post via google groups web interface did not arrive here. That's
the second try. Now via mail.

--
Thomas Guettler http://www.thomas-guettler.de/
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/