PEP-585 complaint: remove type aliases (#93)

This commit is contained in:
2023-04-12 04:09:28 +03:00
committed by GitHub
parent 54d36ccf36
commit abf29083c4
137 changed files with 807 additions and 907 deletions

View File

@ -19,8 +19,9 @@
#
import sqlite3
from collections.abc import Callable
from pathlib import Path
from typing import Any, Callable, Dict, Tuple, TypeVar
from typing import Any, TypeVar
from ahriman.core.log import LazyLogging
@ -46,16 +47,16 @@ class Operations(LazyLogging):
self.path = path
@staticmethod
def factory(cursor: sqlite3.Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:
def factory(cursor: sqlite3.Cursor, row: tuple[Any, ...]) -> dict[str, Any]:
"""
dictionary factory based on official documentation
Args:
cursor(Cursor): cursor descriptor
row(Tuple[Any, ...]): fetched row
row(tuple[Any, ...]): fetched row
Returns:
Dict[str, Any]: row converted to dictionary
dict[str, Any]: row converted to dictionary
"""
result = {}
for index, column in enumerate(cursor.description):