Message136006
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). |
|
Date |
User |
Action |
Args |
2011-05-14 23:42:33 | Darren.Dale | set | recipients:
+ Darren.Dale, ncoghlan, benjamin.peterson, ned.deily, daniel.urban, dsdale24 |
2011-05-14 23:42:33 | Darren.Dale | set | messageid: <1305416553.86.0.773099594914.issue11610@psf.upfronthosting.co.za> |
2011-05-14 23:42:33 | Darren.Dale | link | issue11610 messages |
2011-05-14 23:42:33 | Darren.Dale | create | |
|