summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorshailshouryya <42100758+shailshouryya@users.noreply.github.com>2023-08-11 04:43:13 (GMT)
committerGitHub <noreply@github.com>2023-08-11 04:43:13 (GMT)
commit23a6db98f21cba3af69a921f01613bd5f602bf6d (patch)
tree3d15cf7ff719b77ff109572477627fc606432ebb /Doc/library
parent50bbc56009ae7303d2482f28eb62f2603664b58f (diff)
downloadcpython-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.rst6
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::