From 8894eb1dc25fcbd41d0dd9a8110353cb6ecfe896 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 26 Apr 2021 14:32:17 +0200 Subject: [PATCH 1/3] black: enable skip_magic_trailing_comma --- pyproject.toml | 1 + stdlib/@python2/__builtin__.pyi | 6 +-- stdlib/@python2/builtins.pyi | 6 +-- stdlib/@python2/logging/__init__.pyi | 23 ++-------- stdlib/_typeshed/__init__.pyi | 12 +---- stdlib/asyncio/base_events.pyi | 6 +-- stdlib/builtins.pyi | 14 ++---- stdlib/distutils/filelist.pyi | 12 +---- stdlib/ftplib.pyi | 6 +-- stdlib/importlib/util.pyi | 6 +-- stdlib/logging/config.pyi | 4 +- stdlib/smtpd.pyi | 12 +---- stdlib/tkinter/__init__.pyi | 21 ++------- stdlib/tkinter/ttk.pyi | 5 +-- stdlib/typing.pyi | 11 +---- stubs/JACK-Client/jack/__init__.pyi | 12 +---- .../click-spinner/click_spinner/__init__.pyi | 13 +----- stubs/click/click/formatting.pyi | 7 +-- stubs/docopt/docopt.pyi | 6 +-- stubs/protobuf/google/protobuf/descriptor.pyi | 44 ++----------------- .../protobuf/google/protobuf/json_format.pyi | 5 +-- stubs/redis/redis/client.pyi | 24 +--------- stubs/redis/redis/lock.pyi | 10 +---- stubs/waitress/waitress/compat.pyi | 12 ++--- 24 files changed, 43 insertions(+), 235 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bbc7db728492..fbe58f2b4b28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ line_length = 130 target_version = ["py37"] exclude = ".*_pb2.pyi" +skip_magic_trailing_comma = true [tool.isort] profile = "black" diff --git a/stdlib/@python2/__builtin__.pyi b/stdlib/@python2/__builtin__.pyi index 092f9d47b8aa..ed42c1e8f380 100644 --- a/stdlib/@python2/__builtin__.pyi +++ b/stdlib/@python2/__builtin__.pyi @@ -1007,11 +1007,7 @@ def round(number: SupportsFloat) -> float: ... def round(number: SupportsFloat, ndigits: int) -> float: ... def setattr(__obj: Any, __name: Text, __value: Any) -> None: ... def sorted( - __iterable: Iterable[_T], - *, - cmp: Callable[[_T, _T], int] = ..., - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ..., + __iterable: Iterable[_T], *, cmp: Callable[[_T, _T], int] = ..., key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ... ) -> List[_T]: ... @overload def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... diff --git a/stdlib/@python2/builtins.pyi b/stdlib/@python2/builtins.pyi index 092f9d47b8aa..ed42c1e8f380 100644 --- a/stdlib/@python2/builtins.pyi +++ b/stdlib/@python2/builtins.pyi @@ -1007,11 +1007,7 @@ def round(number: SupportsFloat) -> float: ... def round(number: SupportsFloat, ndigits: int) -> float: ... def setattr(__obj: Any, __name: Text, __value: Any) -> None: ... def sorted( - __iterable: Iterable[_T], - *, - cmp: Callable[[_T, _T], int] = ..., - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ..., + __iterable: Iterable[_T], *, cmp: Callable[[_T, _T], int] = ..., key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ... ) -> List[_T]: ... @overload def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... diff --git a/stdlib/@python2/logging/__init__.pyi b/stdlib/@python2/logging/__init__.pyi index a683113285a1..240215528527 100644 --- a/stdlib/@python2/logging/__init__.pyi +++ b/stdlib/@python2/logging/__init__.pyi @@ -73,24 +73,13 @@ class Logger(Filterer): ) -> None: ... fatal = critical def log( - self, - level: int, - msg: Any, - *args: Any, - exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any, + self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any ) -> None: ... def exception( self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any ) -> None: ... def _log( - self, - level: int, - msg: Any, - args: _ArgsType, - exc_info: Optional[_ExcInfoType] = ..., - extra: Optional[Dict[str, Any]] = ..., + self, level: int, msg: Any, args: _ArgsType, exc_info: Optional[_ExcInfoType] = ..., extra: Optional[Dict[str, Any]] = ... ) -> None: ... # undocumented def filter(self, record: LogRecord) -> bool: ... def addHandler(self, hdlr: Handler) -> None: ... @@ -210,13 +199,7 @@ class LoggerAdapter: self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any ) -> None: ... def log( - self, - level: int, - msg: Any, - *args: Any, - exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any, + self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any ) -> None: ... def isEnabledFor(self, level: int) -> bool: ... diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 039c948fb055..25c48cc3e764 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -104,17 +104,7 @@ OpenTextModeUpdating = Literal[ "t+x", "+tx", ] -OpenTextModeWriting = Literal[ - "w", - "wt", - "tw", - "a", - "at", - "ta", - "x", - "xt", - "tx", -] +OpenTextModeWriting = Literal["w", "wt", "tw", "a", "at", "ta", "x", "xt", "tx",] OpenTextModeReading = Literal["r", "rt", "tr", "U", "rU", "Ur", "rtU", "rUt", "Urt", "trU", "tUr", "Utr"] OpenTextMode = Union[OpenTextModeUpdating, OpenTextModeWriting, OpenTextModeReading] OpenBinaryModeUpdating = Literal[ diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index cdc98e69195d..33079010a8e7 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -33,11 +33,7 @@ class Server(AbstractServer): ssl_handshake_timeout: Optional[float], ) -> None: ... else: - def __init__( - self, - loop: AbstractEventLoop, - sockets: List[socket], - ) -> None: ... + def __init__(self, loop: AbstractEventLoop, sockets: List[socket]) -> None: ... class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def run_forever(self) -> None: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 81316654dee3..de4813a5d961 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -334,10 +334,7 @@ class str(Sequence[str]): def count(self, x: str, __start: Optional[SupportsIndex] = ..., __end: Optional[SupportsIndex] = ...) -> int: ... def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ... def endswith( - self, - __suffix: Union[str, Tuple[str, ...]], - __start: Optional[SupportsIndex] = ..., - __end: Optional[SupportsIndex] = ..., + self, __suffix: Union[str, Tuple[str, ...]], __start: Optional[SupportsIndex] = ..., __end: Optional[SupportsIndex] = ... ) -> bool: ... def expandtabs(self, tabsize: int = ...) -> str: ... def find(self, __sub: str, __start: Optional[SupportsIndex] = ..., __end: Optional[SupportsIndex] = ...) -> int: ... @@ -375,10 +372,7 @@ class str(Sequence[str]): def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... def splitlines(self, keepends: bool = ...) -> List[str]: ... def startswith( - self, - __prefix: Union[str, Tuple[str, ...]], - __start: Optional[SupportsIndex] = ..., - __end: Optional[SupportsIndex] = ..., + self, __prefix: Union[str, Tuple[str, ...]], __start: Optional[SupportsIndex] = ..., __end: Optional[SupportsIndex] = ... ) -> bool: ... def strip(self, __chars: Optional[str] = ...) -> str: ... def swapcase(self) -> str: ... @@ -999,9 +993,7 @@ def eval( __source: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ... ) -> Any: ... def exec( - __source: Union[str, bytes, CodeType], - __globals: Optional[Dict[str, Any]] = ..., - __locals: Optional[Mapping[str, Any]] = ..., + __source: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ... ) -> Any: ... def exit(code: object = ...) -> NoReturn: ... diff --git a/stdlib/distutils/filelist.pyi b/stdlib/distutils/filelist.pyi index ac7cdf8a15ce..99e26218f171 100644 --- a/stdlib/distutils/filelist.pyi +++ b/stdlib/distutils/filelist.pyi @@ -16,11 +16,7 @@ class FileList: def process_template_line(self, line: str) -> None: ... @overload def include_pattern( - self, - pattern: str, - anchor: Union[int, bool] = ..., - prefix: Optional[str] = ..., - is_regex: Literal[0, False] = ..., + self, pattern: str, anchor: Union[int, bool] = ..., prefix: Optional[str] = ..., is_regex: Literal[0, False] = ... ) -> bool: ... @overload def include_pattern(self, pattern: Union[str, Pattern[str]], *, is_regex: Literal[True, 1] = ...) -> bool: ... @@ -34,11 +30,7 @@ class FileList: ) -> bool: ... @overload def exclude_pattern( - self, - pattern: str, - anchor: Union[int, bool] = ..., - prefix: Optional[str] = ..., - is_regex: Literal[0, False] = ..., + self, pattern: str, anchor: Union[int, bool] = ..., prefix: Optional[str] = ..., is_regex: Literal[0, False] = ... ) -> bool: ... @overload def exclude_pattern(self, pattern: Union[str, Pattern[str]], *, is_regex: Literal[True, 1] = ...) -> bool: ... diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 0661301c0827..d3e4758aec47 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -157,9 +157,5 @@ def parse227(resp: str) -> Tuple[str, int]: ... # undocumented def parse229(resp: str, peer: Any) -> Tuple[str, int]: ... # undocumented def parse257(resp: str) -> str: ... # undocumented def ftpcp( - source: FTP, - sourcename: str, - target: FTP, - targetname: str = ..., - type: Literal["A", "I"] = ..., + source: FTP, sourcename: str, target: FTP, targetname: str = ..., type: Literal["A", "I"] = ... ) -> None: ... # undocumented diff --git a/stdlib/importlib/util.pyi b/stdlib/importlib/util.pyi index e2fdcb32cc98..e5d4ec399a22 100644 --- a/stdlib/importlib/util.pyi +++ b/stdlib/importlib/util.pyi @@ -16,11 +16,7 @@ def source_from_cache(path: str) -> str: ... def decode_source(source_bytes: bytes) -> str: ... def find_spec(name: str, package: Optional[str] = ...) -> Optional[importlib.machinery.ModuleSpec]: ... def spec_from_loader( - name: str, - loader: Optional[importlib.abc.Loader], - *, - origin: Optional[str] = ..., - is_package: Optional[bool] = ..., + name: str, loader: Optional[importlib.abc.Loader], *, origin: Optional[str] = ..., is_package: Optional[bool] = ... ) -> Optional[importlib.machinery.ModuleSpec]: ... def spec_from_file_location( name: str, diff --git a/stdlib/logging/config.pyi b/stdlib/logging/config.pyi index 89fa555faa8f..c06f0b25291f 100644 --- a/stdlib/logging/config.pyi +++ b/stdlib/logging/config.pyi @@ -12,9 +12,7 @@ else: def dictConfig(config: dict[str, Any]) -> None: ... def fileConfig( - fname: Union[_Path, IO[str], RawConfigParser], - defaults: Optional[dict[str, str]] = ..., - disable_existing_loggers: bool = ..., + fname: Union[_Path, IO[str], RawConfigParser], defaults: Optional[dict[str, str]] = ..., disable_existing_loggers: bool = ... ) -> None: ... def listen(port: int = ..., verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... def stopListening() -> None: ... diff --git a/stdlib/smtpd.pyi b/stdlib/smtpd.pyi index a4f9bfa6593c..92f078a063f6 100644 --- a/stdlib/smtpd.pyi +++ b/stdlib/smtpd.pyi @@ -87,18 +87,10 @@ class DebuggingServer(SMTPServer): ... class PureProxy(SMTPServer): def process_message( # type: ignore - self, - peer: _Address, - mailfrom: str, - rcpttos: List[Text], - data: Union[bytes, str], + self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str] ) -> Optional[str]: ... class MailmanProxy(PureProxy): def process_message( # type: ignore - self, - peer: _Address, - mailfrom: str, - rcpttos: List[Text], - data: Union[bytes, str], + self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str] ) -> Optional[str]: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index ea61c26198eb..3597344dd965 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -348,10 +348,7 @@ class Misc: # binds do. The default value of func is not str. @overload def bind( - self, - sequence: Optional[str] = ..., - func: Optional[Callable[[Event[Misc]], Any]] = ..., - add: Optional[bool] = ..., + self, sequence: Optional[str] = ..., func: Optional[Callable[[Event[Misc]], Any]] = ..., add: Optional[bool] = ... ) -> str: ... @overload def bind(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... @@ -361,10 +358,7 @@ class Misc: # callbacks will get, so those are Misc. @overload def bind_all( - self, - sequence: Optional[str] = ..., - func: Optional[Callable[[Event[Misc]], Any]] = ..., - add: Optional[bool] = ..., + self, sequence: Optional[str] = ..., func: Optional[Callable[[Event[Misc]], Any]] = ..., add: Optional[bool] = ... ) -> str: ... @overload def bind_all(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... @@ -840,10 +834,7 @@ class Widget(BaseWidget, Pack, Place, Grid): # widgets don't. @overload def bind( - self: _W, - sequence: Optional[str] = ..., - func: Optional[Callable[[Event[_W]], Any]] = ..., - add: Optional[bool] = ..., + self: _W, sequence: Optional[str] = ..., func: Optional[Callable[[Event[_W]], Any]] = ..., add: Optional[bool] = ... ) -> str: ... @overload def bind(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... @@ -2682,11 +2673,7 @@ class Text(Widget, XView, YView): # tag_bind stuff is very similar to Canvas @overload def tag_bind( - self, - tagName: str, - sequence: Optional[str], - func: Optional[Callable[[Event[Text]], Any]], - add: Optional[bool] = ..., + self, tagName: str, sequence: Optional[str], func: Optional[Callable[[Event[Text]], Any]], add: Optional[bool] = ... ) -> str: ... @overload def tag_bind(self, tagName: str, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 7544e13621b3..af3c75142598 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -950,10 +950,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): # Also, it's 'callback' instead of 'func' here. @overload def tag_bind( - self, - tagname: str, - sequence: Optional[str] = ..., - callback: Optional[Callable[[tkinter.Event[Treeview]], Any]] = ..., + self, tagname: str, sequence: Optional[str] = ..., callback: Optional[Callable[[tkinter.Event[Treeview]], Any]] = ... ) -> str: ... @overload def tag_bind(self, tagname: str, sequence: Optional[str], callback: str) -> None: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 03aee05e3216..7f168a9196c2 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -603,12 +603,7 @@ if sys.version_info >= (3, 7): ] else: _get_type_hints_obj_allowed_types = Union[ - object, - Callable[..., Any], - FunctionType, - BuiltinFunctionType, - MethodType, - ModuleType, + object, Callable[..., Any], FunctionType, BuiltinFunctionType, MethodType, ModuleType, ] if sys.version_info >= (3, 9): @@ -621,9 +616,7 @@ if sys.version_info >= (3, 9): else: def get_type_hints( - obj: _get_type_hints_obj_allowed_types, - globalns: Optional[Dict[str, Any]] = ..., - localns: Optional[Dict[str, Any]] = ..., + obj: _get_type_hints_obj_allowed_types, globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ... ) -> Dict[str, Any]: ... if sys.version_info >= (3, 8): diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index daa1032b92d6..62904ecd0e04 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -137,13 +137,7 @@ class Client: can_monitor: bool = ..., is_terminal: bool = ..., ) -> List[Port]: ... - def set_property( - self, - subject: Union[int, str], - key: str, - value: Union[str, bytes], - type: str = ..., - ) -> None: ... + def set_property(self, subject: Union[int, str], key: str, value: Union[str, bytes], type: str = ...) -> None: ... def remove_property(self, subject: Union[int, str], key: str) -> None: ... def remove_properties(self, subject: Union[int, str]) -> int: ... def remove_all_properties(self) -> None: ... @@ -202,9 +196,7 @@ class OwnMidiPort(MidiPort, OwnPort): def max_event_size(self) -> int: ... @property def lost_midi_events(self) -> int: ... - def incoming_midi_events( - self, - ) -> Generator[Tuple[int, _CBufferType], None, None]: ... + def incoming_midi_events(self) -> Generator[Tuple[int, _CBufferType], None, None]: ... def clear_buffer(self) -> None: ... def write_midi_event(self, time: int, event: Union[bytes, Sequence[int], _CBufferType]) -> None: ... def reserve_midi_event(self, time: int, size: int) -> _CBufferType: ... diff --git a/stubs/click-spinner/click_spinner/__init__.pyi b/stubs/click-spinner/click_spinner/__init__.pyi index b941b66ad068..f32f72453588 100644 --- a/stubs/click-spinner/click_spinner/__init__.pyi +++ b/stubs/click-spinner/click_spinner/__init__.pyi @@ -18,22 +18,13 @@ class Spinner(object): stream: _Stream stop_running: Optional[threading.Event] spin_thread: Optional[threading.Thread] - def __init__( - self, - beep: bool, - disable: bool, - force: bool, - stream: _Stream, - ) -> None: ... + def __init__(self, beep: bool, disable: bool, force: bool, stream: _Stream) -> None: ... def start(self) -> None: ... def stop(self) -> None: ... def init_spin(self) -> None: ... def __enter__(self) -> Spinner: ... def __exit__( - self, - exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType], + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] ) -> Literal[False]: ... def spinner(beep: bool, disable: bool, force: bool, stream: _Stream) -> Spinner: ... diff --git a/stubs/click/click/formatting.pyi b/stubs/click/click/formatting.pyi index 1c6b76238384..bcc25e61fb55 100644 --- a/stubs/click/click/formatting.pyi +++ b/stubs/click/click/formatting.pyi @@ -17,12 +17,7 @@ class HelpFormatter: def write(self, string: str) -> None: ... def indent(self) -> None: ... def dedent(self) -> None: ... - def write_usage( - self, - prog: str, - args: str = ..., - prefix: str = ..., - ) -> None: ... + def write_usage(self, prog: str, args: str = ..., prefix: str = ...) -> None: ... def write_heading(self, heading: str) -> None: ... def write_paragraph(self) -> None: ... def write_text(self, text: str) -> None: ... diff --git a/stubs/docopt/docopt.pyi b/stubs/docopt/docopt.pyi index 15c7f7d08cbc..10292ed7995f 100644 --- a/stubs/docopt/docopt.pyi +++ b/stubs/docopt/docopt.pyi @@ -5,9 +5,5 @@ __version__: str _Argv = Union[Iterable[str], str] def docopt( - doc: str, - argv: Optional[_Argv] = ..., - help: bool = ..., - version: Optional[Any] = ..., - options_first: bool = ..., + doc: str, argv: Optional[_Argv] = ..., help: bool = ..., version: Optional[Any] = ..., options_first: bool = ... ) -> dict[str, Any]: ... # Really should be dict[str, Union[str, bool]] diff --git a/stubs/protobuf/google/protobuf/descriptor.pyi b/stubs/protobuf/google/protobuf/descriptor.pyi index 455a0e8513d3..f79fa775b252 100644 --- a/stubs/protobuf/google/protobuf/descriptor.pyi +++ b/stubs/protobuf/google/protobuf/descriptor.pyi @@ -244,59 +244,23 @@ class EnumDescriptor(_NestedDescriptorBase): def GetOptions(self) -> EnumOptions: ... class EnumValueDescriptor(DescriptorBase): - def __new__( - cls, - name, - index, - number, - type=..., - options=..., - serialized_options=..., - create_key=..., - ): ... + def __new__(cls, name, index, number, type=..., options=..., serialized_options=..., create_key=...): ... name: Any index: Any number: Any type: Any - def __init__( - self, - name, - index, - number, - type=..., - options=..., - serialized_options=..., - create_key=..., - ) -> None: ... + def __init__(self, name, index, number, type=..., options=..., serialized_options=..., create_key=...) -> None: ... def GetOptions(self) -> EnumValueOptions: ... class OneofDescriptor: - def __new__( - cls, - name, - full_name, - index, - containing_type, - fields, - options=..., - serialized_options=..., - create_key=..., - ): ... + def __new__(cls, name, full_name, index, containing_type, fields, options=..., serialized_options=..., create_key=...): ... name: Any full_name: Any index: Any containing_type: Any fields: Any def __init__( - self, - name, - full_name, - index, - containing_type, - fields, - options=..., - serialized_options=..., - create_key=..., + self, name, full_name, index, containing_type, fields, options=..., serialized_options=..., create_key=... ) -> None: ... def GetOptions(self) -> OneofOptions: ... diff --git a/stubs/protobuf/google/protobuf/json_format.pyi b/stubs/protobuf/google/protobuf/json_format.pyi index 6cec806569f5..75fda13431a6 100644 --- a/stubs/protobuf/google/protobuf/json_format.pyi +++ b/stubs/protobuf/google/protobuf/json_format.pyi @@ -34,8 +34,5 @@ def Parse( descriptor_pool: Optional[DescriptorPool] = ..., ) -> _MessageT: ... def ParseDict( - js_dict: Any, - message: _MessageT, - ignore_unknown_fields: bool = ..., - descriptor_pool: Optional[DescriptorPool] = ..., + js_dict: Any, message: _MessageT, ignore_unknown_fields: bool = ..., descriptor_pool: Optional[DescriptorPool] = ... ) -> _MessageT: ... diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index 490d6b2dbb21..a0ffc919c20c 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -570,17 +570,7 @@ class Redis(Generic[_StrType]): def xack(self, name, groupname, *ids): ... def xadd(self, name, fields, id=..., maxlen=..., approximate=...): ... def xclaim( - self, - name, - groupname, - consumername, - min_idle_time, - message_ids, - idle=..., - time=..., - retrycount=..., - force=..., - justid=..., + self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=... ): ... def xdel(self, name, *ids): ... def xgroup_create(self, name, groupname, id=..., mkstream=...): ... @@ -995,17 +985,7 @@ class Pipeline(Redis): def xack(self, name, groupname, *ids) -> Pipeline: ... # type: ignore [override] def xadd(self, name, fields, id=..., maxlen=..., approximate=...) -> Pipeline: ... # type: ignore [override] def xclaim( - self, - name, - groupname, - consumername, - min_idle_time, - message_ids, - idle=..., - time=..., - retrycount=..., - force=..., - justid=..., + self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=... ) -> Pipeline: ... # type: ignore [override] def xdel(self, name, *ids) -> Pipeline: ... # type: ignore [override] def xgroup_create(self, name, groupname, id=..., mkstream=...) -> Pipeline: ... # type: ignore [override] diff --git a/stubs/redis/redis/lock.pyi b/stubs/redis/redis/lock.pyi index 0e6090a16d63..842346ecb06f 100644 --- a/stubs/redis/redis/lock.pyi +++ b/stubs/redis/redis/lock.pyi @@ -19,16 +19,10 @@ class Lock: def register_scripts(self) -> None: ... def __enter__(self) -> Lock: ... def __exit__( - self, - exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType], + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType] ) -> Optional[bool]: ... def acquire( - self, - blocking: Optional[bool] = ..., - blocking_timeout: Union[None, int, float] = ..., - token: Optional[_TokenValue] = ..., + self, blocking: Optional[bool] = ..., blocking_timeout: Union[None, int, float] = ..., token: Optional[_TokenValue] = ... ) -> bool: ... def do_acquire(self, token: _TokenValue) -> bool: ... def locked(self) -> bool: ... diff --git a/stubs/waitress/waitress/compat.pyi b/stubs/waitress/waitress/compat.pyi index 42c62f43e32b..e45f4c78bfef 100644 --- a/stubs/waitress/waitress/compat.pyi +++ b/stubs/waitress/waitress/compat.pyi @@ -4,15 +4,9 @@ from typing import Any, Optional, Tuple PY2: bool PY3: bool WIN: bool -string_types: Tuple[ - str, -] -integer_types: Tuple[ - int, -] -class_types: Tuple[ - type, -] +string_types: Tuple[str,] +integer_types: Tuple[int,] +class_types: Tuple[type,] text_type = str binary_type = bytes long = int From 44c25aaad81cb5a4d131b53292ad9b9d2a8aacb2 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 26 Apr 2021 14:41:14 +0200 Subject: [PATCH 2/3] Remove spurious commas --- stdlib/_typeshed/__init__.pyi | 2 +- stubs/waitress/waitress/compat.pyi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 25c48cc3e764..948d4269f575 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -104,7 +104,7 @@ OpenTextModeUpdating = Literal[ "t+x", "+tx", ] -OpenTextModeWriting = Literal["w", "wt", "tw", "a", "at", "ta", "x", "xt", "tx",] +OpenTextModeWriting = Literal["w", "wt", "tw", "a", "at", "ta", "x", "xt", "tx"] OpenTextModeReading = Literal["r", "rt", "tr", "U", "rU", "Ur", "rtU", "rUt", "Urt", "trU", "tUr", "Utr"] OpenTextMode = Union[OpenTextModeUpdating, OpenTextModeWriting, OpenTextModeReading] OpenBinaryModeUpdating = Literal[ diff --git a/stubs/waitress/waitress/compat.pyi b/stubs/waitress/waitress/compat.pyi index e45f4c78bfef..35d92409300a 100644 --- a/stubs/waitress/waitress/compat.pyi +++ b/stubs/waitress/waitress/compat.pyi @@ -4,9 +4,9 @@ from typing import Any, Optional, Tuple PY2: bool PY3: bool WIN: bool -string_types: Tuple[str,] -integer_types: Tuple[int,] -class_types: Tuple[type,] +string_types: Tuple[str] +integer_types: Tuple[int] +class_types: Tuple[type] text_type = str binary_type = bytes long = int From e87b06f1bca14a8b0d0d6b7f2c82fadd2f3add17 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 27 Apr 2021 08:04:07 -0700 Subject: [PATCH 3/3] update black --- requirements-tests-py3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests-py3.txt b/requirements-tests-py3.txt index e693e05ce1f2..401f26cb9955 100644 --- a/requirements-tests-py3.txt +++ b/requirements-tests-py3.txt @@ -2,7 +2,7 @@ # typeshed is released on PyPI. git+https://github.com/python/mypy.git@master typed-ast>=1.0.4 -black==21.4b0 +black==21.4b1 flake8==3.8.4 flake8-bugbear==20.1.4 flake8-pyi==20.10.0