From 4a4498ce7ffba95fef024b0bfac6d777ab118c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Gy=C3=B6rgyi?= Date: Mon, 2 Dec 2024 19:17:11 +0100 Subject: [PATCH] Remove deprecated typing.List uses from base_store.py --- GTG/core/base_store.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GTG/core/base_store.py b/GTG/core/base_store.py index 3adabad01..94d8e81a5 100644 --- a/GTG/core/base_store.py +++ b/GTG/core/base_store.py @@ -25,7 +25,7 @@ import logging from lxml.etree import _Element -from typing import Dict, List, Optional, TypeVar, Generic +from typing import Dict, Optional, TypeVar, Generic from typing_extensions import Self @@ -57,9 +57,9 @@ def has_children(self) -> bool: return len(self.children) > 0 - def get_ancestors(self) -> List[Self]: + def get_ancestors(self) -> list[Self]: """Return all ancestors of this tag""" - ancestors: List[Self] = [] + ancestors: list[Self] = [] here = self while here.parent: here = here.parent @@ -79,7 +79,7 @@ class BaseStore(GObject.Object,Generic[S]): def __init__(self) -> None: self.lookup: Dict[UUID, S] = {} - self.data: List[S] = [] + self.data: list[S] = [] super().__init__() @@ -274,7 +274,7 @@ def print_list(self) -> None: def print_tree(self) -> None: """Print the all the items as a tree.""" - def recursive_print(tree: List, indent: int) -> None: + def recursive_print(tree: list, indent: int) -> None: """Inner print function. """ tab = ' ' * indent if indent > 0 else ''