Darren Dale <[email protected]> added the comment:
It just occurred to me, there is a potential problem with abstractproperty and
the decorator syntax in my patch:
class Foo:
@abstractproperty
def p(self): pass
# p is abstract, but has no abstract methods
@p.setter
def p(self, val): pass
# p has no abstract properties, at this point it becomes an instance
# of property, not abstractproperty
@p.deleter
@abstractmethod
def p(self): pass
# the deleter was tagged as abstract, but p was already a
# regular property. There is no way to turn a regular
# property into an abstractproperty, so the abstractedness
# of the deleter is not respected.
Really, the ideal approach is the original one: provide the builtin property
with an __isabstractmethod__ attribute, which is set to True if the property
has any abstract methods, and False otherwise. (My C is probably too weak to
modify the property builtin on my own).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11610>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com