Eliminate a few Anys in LruCache type hints (#11453)

This commit is contained in:
Sean Quah 2021-11-30 15:39:07 +00:00 committed by GitHub
parent 432a174bc1
commit 5a0b652d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 19 deletions

View file

@ -84,7 +84,7 @@ class ListNode(Generic[P]):
# immediately rather than at the next GC.
self.cache_entry = None
def move_after(self, node: "ListNode") -> None:
def move_after(self, node: "ListNode[P]") -> None:
"""Move this node from its current location in the list to after the
given node.
"""
@ -122,7 +122,7 @@ class ListNode(Generic[P]):
self.prev_node = None
self.next_node = None
def _refs_insert_after(self, node: "ListNode") -> None:
def _refs_insert_after(self, node: "ListNode[P]") -> None:
"""Internal method to insert the node after the given node."""
# This method should only be called when we're not already in the list.