forked from facebookincubator/cinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a non-raising API to clear cached properties
Summary: Adds an API for clearing `cached_property` objects. This can be simulated with a `__set__` and then a delete against it (to avoid raising an exception on the delete, which would de-optimize the calling method in the JIT), but that's very convoluted way of doing it. This still ends up being a little weird - you need to access the `cached_property` via the class, and then pass in the instance as the first argument. But it's a lot better then calling a dunder method. Reviewed By: sinancepel Differential Revision: D36319182 fbshipit-source-id: 6292ff6
- Loading branch information
1 parent
e45880b
commit a92d979
Showing
2 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters