function argument in shutil.register_unpack_format must be Callable (#7083)

This commit is contained in:
Nikita Sobolev
2022-01-30 22:29:36 +03:00
committed by GitHub
parent 136592666b
commit 9854926289

View File

@@ -101,11 +101,13 @@ def make_archive(
logger: Any | None = ...,
) -> str: ...
def get_archive_formats() -> list[tuple[str, str]]: ...
@overload
def register_archive_format(
name: str,
function: Callable[..., Any],
extra_args: Sequence[tuple[str, Any] | list[Any]] | None = ...,
description: str = ...,
name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ...
) -> None: ...
@overload
def register_archive_format(
name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ...
) -> None: ...
def unregister_archive_format(name: str) -> None: ...
@@ -116,8 +118,17 @@ else:
# See http://bugs.python.org/issue30218
def unpack_archive(filename: str, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ...
@overload
def register_unpack_format(
name: str, extensions: list[str], function: Any, extra_args: Sequence[tuple[str, Any]] | None = ..., description: str = ...
name: str,
extensions: list[str],
function: Callable[..., object],
extra_args: Sequence[tuple[str, Any]],
description: str = ...,
) -> None: ...
@overload
def register_unpack_format(
name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ...
) -> None: ...
def unregister_unpack_format(name: str) -> None: ...
def get_unpack_formats() -> list[tuple[str, list[str], str]]: ...