Use basedpyright refactor

This commit is contained in:
marc
2025-03-22 23:06:34 +01:00
parent ac54453b7f
commit 2f7c7c2429
41 changed files with 480 additions and 381 deletions

View File

@@ -1,16 +1,19 @@
import dataclasses
from typing import Optional, TypeVar
from typing import TypeVar
from typing_extensions import override
@dataclasses.dataclass
class WithId:
id: Optional[int]
id: int | None
T = TypeVar("T", bound=WithId)
class IndexedList(list[T]):
@override
def append(self, _item: T) -> None:
if _item.id is None:
_item.id = max((i.id or 0 for i in self), default=0) + 1