Content-Length: 299245 | pFad | http://github.com/pwwang/python-varname/commit/546b57cf6e1819b73f112abe78822f712f18a595

36 fix: update TypeAlias import for compatibility with Python 3.9 · pwwang/python-varname@546b57c · GitHub
Skip to content

Commit 546b57c

Browse files
committed
fix: update TypeAlias import for compatibility with Python 3.9
1 parent 821bb86 commit 546b57c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ python = "^3.8"
2020
executing = "^2.1"
2121
asttokens = { version = "3.*", optional = true }
2222
pure_eval = { version = "0.*", optional = true }
23+
typing_extensions = { version = "^4.13", markers = "python_version < '3.10'" }
2324

2425
[tool.poetry.group.dev.dependencies]
2526
pytest = "^8"

varname/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
from pathlib import Path
1919
from functools import lru_cache, singledispatch
2020
from types import ModuleType, FunctionType, CodeType, FrameType
21-
from typing import Tuple, Union, List, Mapping, Callable, Dict, TypeAlias
21+
from typing import Tuple, Union, List, Mapping, Callable, Dict
22+
23+
if sys.version_info < (3, 10):
24+
from typing_extensions import TypeAlias # pragma: no cover
25+
else:
26+
from typing import TypeAlias
2227

2328
from executing import Source
2429

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/pwwang/python-varname/commit/546b57cf6e1819b73f112abe78822f712f18a595

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy