MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __repr__

Method __repr__

other/lru_cache.py:103–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 self.head.next, self.rear.prev = self.rear, self.head
102
103 def __repr__(self) -> str:
104 rep = ["DoubleLinkedList"]
105 node = self.head
106 while node.next is not None:
107 rep.append(str(node))
108 node = node.next
109 rep.append(str(self.rear))
110 return ",\n ".join(rep)
111
112 def add(self, node: DoubleLinkedListNode[T, U]) -> None:
113 """

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected