Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f6d81d7

Browse files
authoredMar 12, 2024
lfu_cache.py: Use f-strings
1 parent 47c4034 commit f6d81d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎other/lfu_cache.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def __init__(self, key: T | None, val: U | None):
2424
self.prev: DoubleLinkedListNode[T, U] | None = None
2525

2626
def __repr__(self) -> str:
27-
return "Node: key: {}, val: {}, freq: {}, has next: {}, has prev: {}".format(
28-
self.key, self.val, self.freq, self.next is not None, self.prev is not None
27+
return (
28+
f"Node: key: {self.key}, val: {self.val}, freq: {self.freq}, "
29+
f"has next: {self.next is not None}, has prev: {self.prev is not None}"
2930
)
3031

3132

0 commit comments

Comments
 (0)
Please sign in to comment.