This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author the.mulhern
Recipients the.mulhern
Date 2014-02-17.13:43:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392644637.44.0.107261446205.issue20659@psf.upfronthosting.co.za>
In-reply-to
Content
The problems is that it is quite possible to define a property using @property in a class and then later to realize that it really ought to be a class method, not an instance method. But then, if you change it to a class method, using @classmethod annotation, the @property annotation will fail to work. If you are a pedantic person, and name your properties differently than you name your methods, you have to:
1) Change all uses of this former property back to method invocations, with a "()"
2) Change the name, so it now reflects that it is an actual function, not a property any longer.

I think an @classproperty and an @staticproperty decorator would take this problem away.

An alternative would be to make it possible to chain @property and @classmethod. I know that this is sort of doable for ABC.abstractproperty which is now deprecated in favor of @property combined with @ABC.abstractmethod. This would be ideal, but I can not pretend to know if it would be possible. Also, I suspect that the order would matter as it does for ABC as described in http://bugs.python.org/issue16267.
History
Date User Action Args
2014-02-17 13:43:57the.mulhernsetrecipients: + the.mulhern
2014-02-17 13:43:57the.mulhernsetmessageid: <1392644637.44.0.107261446205.issue20659@psf.upfronthosting.co.za>
2014-02-17 13:43:57the.mulhernlinkissue20659 messages
2014-02-17 13:43:56the.mulherncreate