Skip to content

Commit

Permalink
SQ -> Drop support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfstr committed Dec 23, 2023
1 parent aa88dd0 commit e32eb3c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion trycast.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
)
from typing import _eval_type as eval_type # type: ignore[attr-defined]
from typing import _type_repr as type_repr # type: ignore[attr-defined]
from typing import cast, get_args, get_origin, get_type_hints, overload
from typing import cast, get_args, get_origin, overload

try:
from types import UnionType # type: ignore[attr-defined]
Expand All @@ -48,6 +48,16 @@ class UnionType(type): # type: ignore[no-redef]
...


# get_type_hints
try:
# If typing_extensions available,
# understands both typing.* and typing_extensions.* types
from typing_extensions import get_type_hints # type: ignore[attr-defined]
except ImportError:
# If typing_extensions not available
from typing import get_type_hints # type: ignore[misc] # incompatible import


# TypeGuard
if sys.version_info >= (3, 10):
from typing import TypeGuard # Python 3.10+
Expand Down

0 comments on commit e32eb3c

Please sign in to comment.