This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mwilbz
Recipients mwilbz, serhiy.storchaka
Date 2018-10-16.06:01:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539669719.24.0.788709270274.issue34995@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-10-16 06:01:59mwilbzsetrecipients: + mwilbz, serhiy.storchaka
2018-10-16 06:01:59mwilbzsetmessageid: <1539669719.24.0.788709270274.issue34995@psf.upfronthosting.co.za>
2018-10-16 06:01:59mwilbzlinkissue34995 messages
2018-10-16 06:01:58mwilbzcreate