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

@@ -5,8 +5,20 @@
# based on: http: //docs.python.org/2.7/library/re.html
from typing import (
List, Iterator, overload, Callable, Tuple, Sequence, Dict,
Generic, AnyStr, Match, Pattern, Any, Optional, Union
Any,
AnyStr,
Callable,
Dict,
Generic,
Iterator,
List,
Match,
Optional,
Pattern,
Sequence,
Tuple,
Union,
overload,
)
# ----- re variables and constants -----
@@ -32,24 +44,20 @@ class error(Exception): ...
def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...
@overload
def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
@overload
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
@overload
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
@overload
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
@overload
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
@overload
def split(pattern: Union[str, unicode], string: AnyStr,
maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
def split(pattern: Union[str, unicode], string: AnyStr, maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
@overload
def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
def split(
pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, maxsplit: int = ..., flags: int = ...
) -> List[AnyStr]: ...
@overload
def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ...
@overload
@@ -60,41 +68,47 @@ def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flag
# 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: Union[str, unicode], string: AnyStr,
flags: int = ...) -> Iterator[Match[AnyStr]]: ...
def finditer(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Iterator[Match[AnyStr]]: ...
@overload
def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
flags: int = ...) -> Iterator[Match[AnyStr]]: ...
def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Iterator[Match[AnyStr]]: ...
@overload
def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> AnyStr: ...
def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
@overload
def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
def sub(
pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: int = ...
) -> AnyStr: ...
@overload
def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> AnyStr: ...
def sub(
pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...
) -> AnyStr: ...
@overload
def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
def sub(
pattern: Union[Pattern[str], Pattern[unicode]],
repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr,
count: int = ...,
flags: int = ...,
) -> AnyStr: ...
@overload
def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...
) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: int = ...
) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...
) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
def subn(
pattern: Union[Pattern[str], Pattern[unicode]],
repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr,
count: int = ...,
flags: int = ...,
) -> Tuple[AnyStr, int]: ...
def escape(string: AnyStr) -> AnyStr: ...
def purge() -> None: ...
def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ...