Commit c6c0812
committed
Import
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.)TypeAlias from typing_extensions where needed1 parent c6d16d0 commit c6c0812
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
0 commit comments