Matt Wilber <mattwilbe...@gmail.com> added the comment:

I agree, a comment can serve the same purpose. But for the same reasons it's 
useful to express typing hints in Python with real syntax, and the reasons it's 
useful to have the abc module in the first place, I think it is useful to be 
able to annotate an abstract method with @cachedproperty.

The purpose of this change is not to add code developers would try to use at 
runtime, it is to allow developers to communicate their intentions to static 
code analysis tools and to other developers, using standard decorators from 
builtins that do not break one another. Indeed, abstract methods should not be 
executed (on purpose), but Python still supports abstract methods to protect 
developers who want to explicitly label their code as "do not execute".

Therefore, please do not think of this change as something someone would try to 
execute. It is for hinting functionality, and it is to protect developers who 
would decorate a method with @cached_property and @abstractmethod and find that 
abc's functionality was unexpectedly broken.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34995>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to