Message135997
| Author |
benjamin.peterson |
| Recipients |
Darren.Dale, benjamin.peterson, daniel.urban, dsdale24, ncoghlan, ned.deily |
| Date |
2011年05月14日.22:24:11 |
| SpamBayes Score |
2.503008e-07 |
| Marked as misclassified |
No |
| Message-id |
<BANLkTimjxvpagN8T6577riE90j+VncTL3A@mail.gmail.com> |
| In-reply-to |
<BANLkTimirZArCh8V8MYSDmBtOmmqaP6p7Q@mail.gmail.com> |
| Content |
2011年5月14日 Darren Dale <report@bugs.python.org>:
>
> Darren Dale <dsdale24@gmail.com> added the comment:
>
> On Sat, May 14, 2011 at 5:55 PM, Benjamin Peterson
> <report@bugs.python.org> wrote:
>>
>> Benjamin Peterson <benjamin@python.org> added the comment:
>>
>> Okay: how about this. We retain the passing of @abstractmethod to
>> abstractpropert(), but @abstractgetter decorates the method for you.
>
> That can work, although I would advise against it. I find it strange
> that we would use @abstractmethod sometimes and not others. If that is
> what it takes to get the patch accepted, so be it. But since I don't
> understand the motivation behind this approach, I won't be the one to
> document the special cases of when @abstractmethod is required and
> when it is not.
It would just be a convenience.
> It definitely is a common case, and always will be. You can't begin
> using abstractproperty.abstract(getter/setter/deleter) until you have
> an abstract property, which requires passing a (potentially abstract)
> method to the constructor.
What about
@abstractproperty
def something(): pass
@abstractproperty.setter
def set(): pass
@abstractproperty.deleter
def delete: pass
requires you to pass a method (explicitly) to a constructor? |
|