mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import Dict, List, Optional, Tuple, TypeVar
|
||||
from typing import Optional, TypeVar
|
||||
|
||||
_P = TypeVar("_P")
|
||||
_Label = Tuple[int, Optional[str]]
|
||||
_DFA = List[List[Tuple[int, int]]]
|
||||
_DFAS = Tuple[_DFA, Dict[int, int]]
|
||||
_Label = tuple[int, Optional[str]]
|
||||
_DFA = list[list[tuple[int, int]]]
|
||||
_DFAS = tuple[_DFA, dict[int, int]]
|
||||
|
||||
class Grammar:
|
||||
symbol2number: dict[str, int]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from lib2to3.pgen2.token import * # noqa
|
||||
from typing import Callable, Iterable, Iterator, Tuple
|
||||
from typing import Callable, Iterable, Iterator
|
||||
|
||||
_Coord = Tuple[int, int]
|
||||
_Coord = tuple[int, int]
|
||||
_TokenEater = Callable[[int, str, _Coord, _Coord, str], None]
|
||||
_TokenInfo = Tuple[int, str, _Coord, _Coord, str]
|
||||
_TokenInfo = tuple[int, str, _Coord, _Coord, str]
|
||||
|
||||
class TokenError(Exception): ...
|
||||
class StopTokenizing(Exception): ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
|
||||
from typing import Any, Callable, Iterator, Optional, TypeVar, Union
|
||||
|
||||
_P = TypeVar("_P")
|
||||
_NL = Union[Node, Leaf]
|
||||
_Context = Tuple[str, int, int]
|
||||
_Results = Dict[str, _NL]
|
||||
_RawNode = Tuple[int, str, _Context, Optional[List[_NL]]]
|
||||
_Context = tuple[str, int, int]
|
||||
_Results = dict[str, _NL]
|
||||
_RawNode = tuple[int, str, _Context, Optional[list[_NL]]]
|
||||
_Convert = Callable[[Grammar, _RawNode], Any]
|
||||
|
||||
HUGE: int
|
||||
|
||||
Reference in New Issue
Block a user