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

@@ -6,10 +6,7 @@
# and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py
import sys
from typing import (
List, Iterator, overload, Callable, Tuple,
AnyStr, Any, Optional, Union
)
from typing import Any, AnyStr, Callable, Iterator, List, Optional, Tuple, Union, overload
# ----- re variables and constants -----
if sys.version_info >= (3, 7):
@@ -37,7 +34,6 @@ if sys.version_info >= (3, 6):
UNICODE: int
T: int
TEMPLATE: int
A = RegexFlag.A
ASCII = RegexFlag.ASCII
DEBUG = RegexFlag.DEBUG
@@ -86,12 +82,10 @@ class error(Exception): ...
def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
@overload
def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
@overload
def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
@overload
def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
@overload
def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
@overload
@@ -102,14 +96,10 @@ def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) ->
def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
@overload
def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
@overload
def split(pattern: AnyStr, string: AnyStr,
maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ...
def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ...
@overload
def split(pattern: Pattern[AnyStr], string: AnyStr,
maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ...
def split(pattern: Pattern[AnyStr], string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ...
@overload
def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ...
@overload
@@ -120,41 +110,35 @@ def findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -
# matches are returned in the order found. Empty matches are included in the
# result unless they touch the beginning of another match.
@overload
def finditer(pattern: AnyStr, string: AnyStr,
flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ...
def finditer(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ...
@overload
def finditer(pattern: Pattern[AnyStr], string: AnyStr,
flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ...
def finditer(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ...
@overload
def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> AnyStr: ...
def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ...
@overload
def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ...
def sub(
pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ...
) -> AnyStr: ...
@overload
def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> AnyStr: ...
def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ...
@overload
def sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ...
def sub(
pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ...
) -> AnyStr: ...
@overload
def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ...
def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ...
) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...
) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ...
) -> Tuple[AnyStr, int]: ...
def escape(pattern: AnyStr) -> AnyStr: ...
def purge() -> None: ...
def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...