Message327810
This allows a developer to add a @cached_property to a method with the @abstractmethod decorator, without breaking the check for abstract methods on ABC instantiation. That is, if you tried to instantiate an ABC with a method that had a method decorated with @cached_property and @abstractmethod now, it would succeed, instead of throwing a TypeError as you might expect.
As for why you'd put @cached_property on an abstract method, it's useful for IDEs and type checkers to know that the method is implemented with a property, and that users of the method (and its implementations) can reasonably call it multiple times and know caching is occurring. |
|
Date |
User |
Action |
Args |
2018-10-16 06:01:59 | mwilbz | set | recipients:
+ mwilbz, serhiy.storchaka |
2018-10-16 06:01:59 | mwilbz | set | messageid: <1539669719.24.0.788709270274.issue34995@psf.upfronthosting.co.za> |
2018-10-16 06:01:59 | mwilbz | link | issue34995 messages |
2018-10-16 06:01:58 | mwilbz | create | |
|