mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-05-21 00:05:13 +00:00
fix: use type parameter instead of subclass
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user