From 5643c32f7f2c886015df459f26b4d72adaee1207 Mon Sep 17 00:00:00 2001 From: Hernan Grecco Date: Mon, 1 May 2023 19:59:19 -0300 Subject: [PATCH] Fix 3.9 support. TypeAlias is supported in 3.10+ --- pint/util.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pint/util.py b/pint/util.py index 149945bcf..d75d1b5f4 100644 --- a/pint/util.py +++ b/pint/util.py @@ -24,7 +24,6 @@ from typing import ( TYPE_CHECKING, ClassVar, - TypeAlias, Callable, TypeVar, Any, @@ -48,8 +47,12 @@ T = TypeVar("T") TH = TypeVar("TH", bound=Hashable) -ItMatrix: TypeAlias = Iterable[Iterable[PintScalar]] -Matrix: TypeAlias = list[list[PintScalar]] + +# TODO: Change when Python 3.10 becomes minimal version. +# ItMatrix: TypeAlias = Iterable[Iterable[PintScalar]] +# Matrix: TypeAlias = list[list[PintScalar]] +ItMatrix = Iterable[Iterable[PintScalar]] +Matrix = list[list[PintScalar]] def _noop(x: T) -> T: