We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca71208 commit 3985535Copy full SHA for 3985535
leetcode_py/data_structures/list_node.py
@@ -1,10 +1,10 @@
1
-# from typing import Generic, TypeVar
+from typing import Generic, TypeVar
2
3
-# # TODO: Remove TypeVar when minimum Python version is 3.12+ (use class ListNode[T]: syntax)
4
-# T = TypeVar("T")
+# TODO: Remove TypeVar when minimum Python version is 3.12+ (use class ListNode[T]: syntax)
+T = TypeVar("T")
5
6
7
-class ListNode[T]:
+class ListNode(Generic[T]):
8
def __init__(self, val: T, next: "ListNode[T] | None" = None):
9
self.val = val
10
self.next = next
0 commit comments