[Python-Dev] improvement to declaring abstract properties

Darren Dale dsdale24 at gmail.com
Sat Mar 19 20:06:54 CET 2011


I suggested at python-ideas a way that the declaration of abstract
properties could be improved to support the decorator syntax:
http://mail.python.org/pipermail/python-ideas/2011-March/009411.html .
A relatively small change to the property builtin would allow
properties to identify themselves as abstract when they are passed
abstract methods (the same way that function objects identify
themselves as abstract when decorated with @abstractmethod). As a
result, @abstractproperty would no longer be needed.

 I submitted a patch at http://bugs.python.org/issue11610. It includes
the changes to the property builtin, documentation, and unit tests.
Unfortunately, I have not been able to python-3.3 from a mercurial
checkout on either Ubuntu 11.04 or OS X 10.6.6 (for reasons unrelated
to the patch), and so I have not been able to test the patch.

Darren


More information about the Python-Dev mailing list