apply black and isort (#4287)

* apply black and isort

* move some type ignores
This commit is contained in:
Jelle Zijlstra
2020-06-28 13:31:00 -07:00
committed by GitHub
parent fe58699ca5
commit 5d553c9584
800 changed files with 13875 additions and 10332 deletions

View File

@@ -1,10 +1,9 @@
from _typeshed import StrPath
from typing import Any, IO, Iterable, Optional, Text
from logging import Logger
from lib2to3.pytree import _Convert, _NL
from lib2to3.pgen2.grammar import Grammar
from lib2to3.pytree import _NL, _Convert
from logging import Logger
from typing import IO, Any, Iterable, Optional, Text
from _typeshed import StrPath
class Driver:
grammar: Grammar
@@ -17,4 +16,6 @@ class Driver:
def parse_file(self, filename: StrPath, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ...
def parse_string(self, text: Text, debug: bool = ...) -> _NL: ...
def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ...
def load_grammar(
gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...
) -> Grammar: ...

View File

@@ -1,7 +1,8 @@
from _typeshed import StrPath
from typing import Dict, List, Optional, Text, Tuple, TypeVar
_P = TypeVar('_P')
from _typeshed import StrPath
_P = TypeVar("_P")
_Label = Tuple[int, Optional[Text]]
_DFA = List[List[Tuple[int, int]]]
_DFAS = Tuple[_DFA, Dict[int, int]]

View File

@@ -1,9 +1,8 @@
# Stubs for lib2to3.pgen2.parse (Python 3.6)
from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple
from lib2to3.pgen2.grammar import Grammar, _DFAS
from lib2to3.pgen2.grammar import _DFAS, Grammar
from lib2to3.pytree import _NL, _Convert, _RawNode
from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple
_Context = Sequence[Any]

View File

@@ -1,10 +1,8 @@
from _typeshed import StrPath
from typing import (
Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
)
from lib2to3.pgen2 import grammar
from lib2to3.pgen2.tokenize import _TokenInfo
from typing import IO, Any, Dict, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
from _typeshed import StrPath
class PgenGrammar(grammar.Grammar): ...

View File

@@ -1,15 +1,13 @@
# Stubs for lib2to3.pgen2.tokenize (Python 3.6)
# NOTE: Only elements from __all__ are present.
from typing import Callable, Iterable, Iterator, List, Text, Tuple
from lib2to3.pgen2.token import * # noqa
from typing import Callable, Iterable, Iterator, List, Text, Tuple
_Coord = Tuple[int, int]
_TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None]
_TokenInfo = Tuple[int, Text, _Coord, _Coord, Text]
class TokenError(Exception): ...
class StopTokenizing(Exception): ...
@@ -25,6 +23,4 @@ class Untokenizer:
def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ...
def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ...
def generate_tokens(
readline: Callable[[], Text]
) -> Iterator[_TokenInfo]: ...
def generate_tokens(readline: Callable[[], Text]) -> Iterator[_TokenInfo]: ...

View File

@@ -1,7 +1,7 @@
# Stubs for lib2to3.pygram (Python 3.6)
from typing import Any
from lib2to3.pgen2.grammar import Grammar
from typing import Any
class Symbols:
def __init__(self, grammar: Grammar) -> None: ...

View File

@@ -1,11 +1,10 @@
# Stubs for lib2to3.pytree (Python 3.6)
import sys
from lib2to3.pgen2.grammar import Grammar
from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union
from lib2to3.pgen2.grammar import Grammar
_P = TypeVar('_P')
_P = TypeVar("_P")
_NL = Union[Node, Leaf]
_Context = Tuple[Text, int, int]
_Results = Dict[Text, _NL]
@@ -45,7 +44,14 @@ class Base:
class Node(Base):
fixers_applied: List[Any]
def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ...
def __init__(
self,
type: int,
children: List[_NL],
context: Optional[Any] = ...,
prefix: Optional[Text] = ...,
fixers_applied: Optional[List[Any]] = ...,
) -> None: ...
def set_child(self, i: int, child: _NL) -> None: ...
def insert_child(self, i: int, child: _NL) -> None: ...
def append_child(self, child: _NL) -> None: ...
@@ -55,7 +61,14 @@ class Leaf(Base):
column: int
value: Text
fixers_applied: List[Any]
def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ...
def __init__(
self,
type: int,
value: Text,
context: Optional[_Context] = ...,
prefix: Optional[Text] = ...,
fixers_applied: List[Any] = ...,
) -> None: ...
def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ...