Various ruff fixes (#12821)

This commit is contained in:
Christian Clauss
2025-07-06 00:35:29 +02:00
committed by GitHub
parent 7665ba5e25
commit cd3c3c3130
25 changed files with 69 additions and 70 deletions

View File

@ -7,13 +7,13 @@ from __future__ import annotations
from itertools import pairwise
from random import random
from typing import Generic, TypeVar
from typing import TypeVar
KT = TypeVar("KT")
VT = TypeVar("VT")
class Node(Generic[KT, VT]):
class Node[KT, VT]:
def __init__(self, key: KT | str = "root", value: VT | None = None):
self.key = key
self.value = value
@ -49,7 +49,7 @@ class Node(Generic[KT, VT]):
return len(self.forward)
class SkipList(Generic[KT, VT]):
class SkipList[KT, VT]:
def __init__(self, p: float = 0.5, max_level: int = 16):
self.head: Node[KT, VT] = Node[KT, VT]()
self.level = 0