From 70de571ef4fb3fd6d3b653f015327ef82cae409b Mon Sep 17 00:00:00 2001 From: Jann Stute Date: Mon, 11 May 2026 20:31:56 +0200 Subject: [PATCH] fix: use type parameter instead of subclass --- src/tagstudio/core/query_lang/ast.py | 4 ++-- src/tagstudio/qt/ts_qt.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tagstudio/core/query_lang/ast.py b/src/tagstudio/core/query_lang/ast.py index 6a4375e2..9d97d016 100644 --- a/src/tagstudio/core/query_lang/ast.py +++ b/src/tagstudio/core/query_lang/ast.py @@ -4,7 +4,7 @@ from abc import ABC, abstractmethod from enum import Enum -from typing import Generic, TypeVar, override +from typing import TypeVar, override class ConstraintType(Enum): @@ -97,7 +97,7 @@ class Not(AST): T = TypeVar("T") -class BaseVisitor(ABC, Generic[T]): +class BaseVisitor[T](ABC): def visit(self, node: AST) -> T: if isinstance(node, ANDList): return self.visit_and_list(node) diff --git a/src/tagstudio/qt/ts_qt.py b/src/tagstudio/qt/ts_qt.py index 17daae29..538c053e 100644 --- a/src/tagstudio/qt/ts_qt.py +++ b/src/tagstudio/qt/ts_qt.py @@ -21,7 +21,7 @@ from collections import OrderedDict from pathlib import Path from queue import Queue from shutil import which -from typing import Generic, TypeVar +from typing import TypeVar from warnings import catch_warnings import structlog @@ -148,7 +148,7 @@ T = TypeVar("T") # | A [B]<- C | # |[A]<- B C | Previous routes still exist # | A ->[D] | Stack is cut from [:A] on new route -class History(Generic[T]): +class History[T]: __history: list[T] __index: int = 0