|
8 | 8 | from typing import (
|
9 | 9 | Any, TypeVar, List, Tuple, cast, Set, Dict, Union, Optional, Callable, Sequence, Iterator
|
10 | 10 | )
|
11 |
| -from typing_extensions import DefaultDict, Final, TYPE_CHECKING |
| 11 | +from typing_extensions import DefaultDict, Final, TYPE_CHECKING, TypeAlias as _TypeAlias |
12 | 12 | from mypy_extensions import trait
|
13 | 13 |
|
14 | 14 | import mypy.strconv
|
@@ -64,7 +64,7 @@ def get_column(self) -> int:
|
64 | 64 |
|
65 | 65 | T = TypeVar('T')
|
66 | 66 |
|
67 |
| -JsonDict = Dict[str, Any] |
| 67 | +JsonDict: _TypeAlias = Dict[str, Any] |
68 | 68 |
|
69 | 69 |
|
70 | 70 | # Symbol table node kinds
|
@@ -208,7 +208,7 @@ class FakeExpression(Expression):
|
208 | 208 | # TODO:
|
209 | 209 | # Lvalue = Union['NameExpr', 'MemberExpr', 'IndexExpr', 'SuperExpr', 'StarExpr'
|
210 | 210 | # 'TupleExpr']; see #1783.
|
211 |
| -Lvalue = Expression |
| 211 | +Lvalue: _TypeAlias = Expression |
212 | 212 |
|
213 | 213 |
|
214 | 214 | @trait
|
@@ -241,7 +241,7 @@ def deserialize(cls, data: JsonDict) -> 'SymbolNode':
|
241 | 241 |
|
242 | 242 |
|
243 | 243 | # Items: fullname, related symbol table node, surrounding type (if any)
|
244 |
| -Definition = Tuple[str, 'SymbolTableNode', Optional['TypeInfo']] |
| 244 | +Definition: _TypeAlias = Tuple[str, 'SymbolTableNode', Optional['TypeInfo']] |
245 | 245 |
|
246 | 246 |
|
247 | 247 | class MypyFile(SymbolNode):
|
@@ -514,7 +514,7 @@ def fullname(self) -> Bogus[str]:
|
514 | 514 | return self._fullname
|
515 | 515 |
|
516 | 516 |
|
517 |
| -OverloadPart = Union['FuncDef', 'Decorator'] |
| 517 | +OverloadPart: _TypeAlias = Union['FuncDef', 'Decorator'] |
518 | 518 |
|
519 | 519 |
|
520 | 520 | class OverloadedFuncDef(FuncBase, SymbolNode, Statement):
|
|
0 commit comments