You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import TypeAlias from typing_extensions where needed
The standard library `typing` module introduced `TypeAlias` in
Python 3.10. This uses it from `typing_extensions` where neederd,
by making three changes:
- Change the version lower bound for `typing-extensions` from
3.7.4.3 to 3.10.0.2, since 3.7.4.3 doesn't offer `TypeAlias`.
(The reason not to go higher, to major version 4, is that
it no longer supports versions of Python lower than 3.9, but
we currently support Python 3.7 and Python 3.8.)
- Require the `typing-extensions` dependency when using Python
versions lower than 3.10, rather than only lower than 3.7 as
before.
- Conditionally import `TypeAlias` (in the `git.cmd` module) from
either `typing` or `type_extensions` depending on the Python
version, using a pattern that `mypy` and other type checkers
recognize statically.
Together with the preceding commit, this fixes#2038. (This is
approach (2) described there.)
0 commit comments