diff options
author | Jordan Cook <jordan.cook.git@proton.me> | 2022-10-21 12:50:34 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook.git@proton.me> | 2022-10-26 12:53:46 -0500 |
commit | 13a7ca785d547260d833a2aeac2ffb1d151eb1f9 (patch) | |
tree | d8f7478db803eca6e85987263058601cd52ceaa7 /requests_cache | |
parent | 843612d60ffbef81b877c77042415a167d5059b9 (diff) | |
download | requests-cache-13a7ca785d547260d833a2aeac2ffb1d151eb1f9.tar.gz |
Add more notes on deprecated methods
Diffstat (limited to 'requests_cache')
-rw-r--r-- | requests_cache/backends/base.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/requests_cache/backends/base.py b/requests_cache/backends/base.py index 083bc71..bc57ca1 100644 --- a/requests_cache/backends/base.py +++ b/requests_cache/backends/base.py @@ -251,6 +251,14 @@ class BaseCache: return str(self) # Deprecated methods + # + # Note: delete_urls(), has_key(), keys(), values(), and response_count() were added relatively + # recently and appear to not be widely used, so these will likely be removed within 1 or 2 + # minor releases. + # + # The methods delete_url(), has_url() and remove_expired_responses() have been around for longer + # and have appeared in various examples in the docs, so these will likely stick around longer + # (or could be kept indefinitely if someone really needs them) # -------------------- def delete_url(self, url: str, method: str = 'GET', **kwargs): @@ -310,7 +318,11 @@ class BaseCache: self.delete(expired=True, invalid=True) def values(self, check_expiry: bool = False) -> Iterator[CachedResponse]: - warn('BaseCache.values() is deprecated; please use .filter() instead', DeprecationWarning) + warn( + 'BaseCache.values() is deprecated; ' + 'please use .filter() or BaseCache.responses.values() instead', + DeprecationWarning, + ) yield from self.filter(expired=not check_expiry) |