Skip to content

Commit

Permalink
Fix 3.9 support. TypeAlias is supported in 3.10+
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed May 1, 2023
1 parent bcd32b0 commit 5643c32
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pint/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from typing import (
TYPE_CHECKING,
ClassVar,
TypeAlias,
Callable,
TypeVar,
Any,
Expand All @@ -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:
Expand Down

0 comments on commit 5643c32

Please sign in to comment.