diff options
author | shailshouryya <42100758+shailshouryya@users.noreply.github.com> | 2023-08-11 04:43:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 04:43:13 (GMT) |
commit | 23a6db98f21cba3af69a921f01613bd5f602bf6d (patch) | |
tree | 3d15cf7ff719b77ff109572477627fc606432ebb /Doc/library | |
parent | 50bbc56009ae7303d2482f28eb62f2603664b58f (diff) | |
download | cpython-23a6db98f21cba3af69a921f01613bd5f602bf6d.zip cpython-23a6db98f21cba3af69a921f01613bd5f602bf6d.tar.gz cpython-23a6db98f21cba3af69a921f01613bd5f602bf6d.tar.bz2 |
gh-107421: Clarify `OrderedDict` Examples and Recipes (#107613)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/collections.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index bb46782..b8b231b 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -1224,7 +1224,7 @@ variants of :func:`functools.lru_cache`: result = self.func(*args) self.cache[args] = time(), result if len(self.cache) > self.maxsize: - self.cache.popitem(0) + self.cache.popitem(last=False) return result @@ -1256,12 +1256,12 @@ variants of :func:`functools.lru_cache`: if self.requests[args] <= self.cache_after: self.requests.move_to_end(args) if len(self.requests) > self.maxrequests: - self.requests.popitem(0) + self.requests.popitem(last=False) else: self.requests.pop(args, None) self.cache[args] = result if len(self.cache) > self.maxsize: - self.cache.popitem(0) + self.cache.popitem(last=False) return result .. doctest:: |