[Python-ideas] Properties for classes possible?
Thomas Güttler
guettliml at thomas-guettler.de
Thu Aug 20 17:34:30 CEST 2015
Am 20.08.2015 um 17:27 schrieb Joseph Jevnik:
> How are metaclasses unpythonic? This is one of the more defining features of python. There will be no way to properly
> implement this without moving the descriptor up to the metaclass. When thinking about metaclasses, it is often best to
> just think of them as classes and other types as instances.
Yes, metaclasses are a great feature for experts.
For me this syntax is the most readable:
> class MyClass:
> @classproperty
> def prop(cls):
> return '42'--
More information about the Python-ideas
mailing list