fix: resolve typing errors

This commit is contained in:
Mike A.
2025-11-08 14:58:09 +01:00
parent fa722c267b
commit 59a55e070b
5 changed files with 12 additions and 13 deletions

View File

@@ -1,10 +1,8 @@
"""Utility types."""
from collections.abc import Coroutine
from typing import TypeVar, Union
from typing import TypeAlias, TypeVar
_T = TypeVar("_T")
# Cannot use `|` operator (PEP 604) in python 3.9,
# even with __future__ import since it is evaluated directly
MaybeCoro = Union[_T, Coroutine[None, None, _T]]
MaybeCoro: TypeAlias = _T | Coroutine[None, None, _T]