Author Darren.Dale
Recipients Darren.Dale, benjamin.peterson, daniel.urban, dsdale24, ncoghlan, ned.deily
Date 2011-05-14.23:42:33
SpamBayes Score 7.97547e-08
Marked as misclassified No
Message-id <1305416553.86.0.773099594914.issue11610@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2011-05-14 23:42:33Darren.Dalesetrecipients: + Darren.Dale, ncoghlan, benjamin.peterson, ned.deily, daniel.urban, dsdale24
2011-05-14 23:42:33Darren.Dalesetmessageid: <1305416553.86.0.773099594914.issue11610@psf.upfronthosting.co.za>
2011-05-14 23:42:33Darren.Dalelinkissue11610 messages
2011-05-14 23:42:33Darren.Dalecreate