mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-27 21:32:12 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -89,10 +89,10 @@ PAX_NAME_FIELDS: set[str]
|
||||
ENCODING: str
|
||||
|
||||
def open(
|
||||
name: StrOrBytesPath | None = ...,
|
||||
mode: str = ...,
|
||||
fileobj: IO[bytes] | None = ..., # depends on mode
|
||||
bufsize: int = ...,
|
||||
name: StrOrBytesPath | None = None,
|
||||
mode: str = "r",
|
||||
fileobj: IO[bytes] | None = None, # depends on mode
|
||||
bufsize: int = 10240,
|
||||
*,
|
||||
format: int | None = ...,
|
||||
tarinfo: type[TarInfo] | None = ...,
|
||||
@@ -127,19 +127,19 @@ class TarFile:
|
||||
offset: int # undocumented
|
||||
def __init__(
|
||||
self,
|
||||
name: StrOrBytesPath | None = ...,
|
||||
mode: Literal["r", "a", "w", "x"] = ...,
|
||||
fileobj: _Fileobj | None = ...,
|
||||
format: int | None = ...,
|
||||
tarinfo: type[TarInfo] | None = ...,
|
||||
dereference: bool | None = ...,
|
||||
ignore_zeros: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str = ...,
|
||||
pax_headers: Mapping[str, str] | None = ...,
|
||||
debug: int | None = ...,
|
||||
errorlevel: int | None = ...,
|
||||
copybufsize: int | None = ..., # undocumented
|
||||
name: StrOrBytesPath | None = None,
|
||||
mode: Literal["r", "a", "w", "x"] = "r",
|
||||
fileobj: _Fileobj | None = None,
|
||||
format: int | None = None,
|
||||
tarinfo: type[TarInfo] | None = None,
|
||||
dereference: bool | None = None,
|
||||
ignore_zeros: bool | None = None,
|
||||
encoding: str | None = None,
|
||||
errors: str = "surrogateescape",
|
||||
pax_headers: Mapping[str, str] | None = None,
|
||||
debug: int | None = None,
|
||||
errorlevel: int | None = None,
|
||||
copybufsize: int | None = None, # undocumented
|
||||
) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
@@ -149,10 +149,10 @@ class TarFile:
|
||||
@classmethod
|
||||
def open(
|
||||
cls: type[Self],
|
||||
name: StrOrBytesPath | None = ...,
|
||||
mode: str = ...,
|
||||
fileobj: IO[bytes] | None = ..., # depends on mode
|
||||
bufsize: int = ...,
|
||||
name: StrOrBytesPath | None = None,
|
||||
mode: str = "r",
|
||||
fileobj: IO[bytes] | None = None, # depends on mode
|
||||
bufsize: int = 10240,
|
||||
*,
|
||||
format: int | None = ...,
|
||||
tarinfo: type[TarInfo] | None = ...,
|
||||
@@ -168,8 +168,8 @@ class TarFile:
|
||||
def taropen(
|
||||
cls: type[Self],
|
||||
name: StrOrBytesPath | None,
|
||||
mode: Literal["r", "a", "w", "x"] = ...,
|
||||
fileobj: _Fileobj | None = ...,
|
||||
mode: Literal["r", "a", "w", "x"] = "r",
|
||||
fileobj: _Fileobj | None = None,
|
||||
*,
|
||||
compresslevel: int = ...,
|
||||
format: int | None = ...,
|
||||
@@ -257,9 +257,9 @@ class TarFile:
|
||||
def xzopen(
|
||||
cls: type[Self],
|
||||
name: StrOrBytesPath | None,
|
||||
mode: Literal["r", "w", "x"] = ...,
|
||||
fileobj: IO[bytes] | None = ...,
|
||||
preset: int | None = ...,
|
||||
mode: Literal["r", "w", "x"] = "r",
|
||||
fileobj: IO[bytes] | None = None,
|
||||
preset: int | None = None,
|
||||
*,
|
||||
format: int | None = ...,
|
||||
tarinfo: type[TarInfo] | None = ...,
|
||||
@@ -273,16 +273,16 @@ class TarFile:
|
||||
def getmember(self, name: str) -> TarInfo: ...
|
||||
def getmembers(self) -> _list[TarInfo]: ...
|
||||
def getnames(self) -> _list[str]: ...
|
||||
def list(self, verbose: bool = ..., *, members: _list[TarInfo] | None = ...) -> None: ...
|
||||
def list(self, verbose: bool = True, *, members: _list[TarInfo] | None = None) -> None: ...
|
||||
def next(self) -> TarInfo | None: ...
|
||||
def extractall(
|
||||
self, path: StrOrBytesPath = ..., members: Iterable[TarInfo] | None = ..., *, numeric_owner: bool = ...
|
||||
self, path: StrOrBytesPath = ".", members: Iterable[TarInfo] | None = None, *, numeric_owner: bool = False
|
||||
) -> None: ...
|
||||
def extract(
|
||||
self, member: str | TarInfo, path: StrOrBytesPath = ..., set_attrs: bool = ..., *, numeric_owner: bool = ...
|
||||
self, member: str | TarInfo, path: StrOrBytesPath = "", set_attrs: bool = True, *, numeric_owner: bool = False
|
||||
) -> None: ...
|
||||
def _extract_member(
|
||||
self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = ..., numeric_owner: bool = ...
|
||||
self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = True, numeric_owner: bool = False
|
||||
) -> None: ... # undocumented
|
||||
def extractfile(self, member: str | TarInfo) -> IO[bytes] | None: ...
|
||||
def makedir(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented
|
||||
@@ -297,14 +297,14 @@ class TarFile:
|
||||
def add(
|
||||
self,
|
||||
name: StrPath,
|
||||
arcname: StrPath | None = ...,
|
||||
recursive: bool = ...,
|
||||
arcname: StrPath | None = None,
|
||||
recursive: bool = True,
|
||||
*,
|
||||
filter: Callable[[TarInfo], TarInfo | None] | None = ...,
|
||||
filter: Callable[[TarInfo], TarInfo | None] | None = None,
|
||||
) -> None: ...
|
||||
def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = ...) -> None: ...
|
||||
def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = None) -> None: ...
|
||||
def gettarinfo(
|
||||
self, name: StrOrBytesPath | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ...
|
||||
self, name: StrOrBytesPath | None = None, arcname: str | None = None, fileobj: IO[bytes] | None = None
|
||||
) -> TarInfo: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -344,7 +344,7 @@ class TarInfo:
|
||||
uname: str
|
||||
gname: str
|
||||
pax_headers: Mapping[str, str]
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
def __init__(self, name: str = "") -> None: ...
|
||||
@classmethod
|
||||
def frombuf(cls: Type[Self], buf: bytes | bytearray, encoding: str, errors: str) -> Self: ...
|
||||
@classmethod
|
||||
@@ -354,7 +354,7 @@ class TarInfo:
|
||||
@linkpath.setter
|
||||
def linkpath(self, linkname: str) -> None: ...
|
||||
def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ...
|
||||
def tobuf(self, format: int | None = ..., encoding: str | None = ..., errors: str = ...) -> bytes: ...
|
||||
def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ...
|
||||
def create_ustar_header(
|
||||
self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str
|
||||
) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user