Erik Bray added the comment:

A read-only classproperty is fairly trivial to implement in pure Python and has 
been done.

A good reason to have a classproperty implementation in CPython would be to 
support settable/deleteable classproperties.  The problem is that can't be done 
with the descriptor protocol on its own without a custom metaclass.  
classproperty would have to somehow be special-cased, perhaps in type_setattro, 
say.  I don't know if that can just be done lightly.

Otherwise I don't see the advantage of adding a classproperty type to CPython?

----------
nosy: +erik.bray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24941>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to