misc: drop typing as T, use builtin generics

Python 3.10 is the minimum, so annotations use `X | None`, `list[X]`
and friends, enforced by ruff's pyupgrade rules. The remaining typing
names are imported directly, with abstract types coming from
collections.abc. first() is now generic over the item and default.
This commit is contained in:
Dash committed 2026-10-17 15:55:55 +02:00
1 parent ada8d5b6ed
commit 0a4358e2b8
40 files changed
+248 -236

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
import typing as T
from typing import Any
from pqcli.ui.curses.event_handler import EventHandler
from pqcli.ui.curses.util import Choice
@@ -8,7 +8,7 @@ from pqcli.ui.curses.widgets import Menu
class MenuView(BaseView):
def __init__(
self, screen: T.Any, title: str, active_choice: int = 0
self, screen: Any, title: str, active_choice: int = 0
) -> None:
super().__init__(screen)
@@ -16,7 +16,7 @@ class MenuView(BaseView):
self.on_confirm = EventHandler()
self._title = f"{title}:"
self._choices: T.List[Choice] = []
self._choices: list[Choice] = []
self._active_choice = active_choice
def start(self) -> None: