mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 19:01:15 +08:00
black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma * Remove spurious commas
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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[
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user