mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -81,8 +81,8 @@ class Path(PurePath):
|
||||
@classmethod
|
||||
def cwd(cls: type[Self]) -> Self: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ...
|
||||
def chmod(self, mode: int, *, follow_symlinks: bool = ...) -> None: ...
|
||||
def stat(self, *, follow_symlinks: bool = True) -> stat_result: ...
|
||||
def chmod(self, mode: int, *, follow_symlinks: bool = True) -> None: ...
|
||||
else:
|
||||
def stat(self) -> stat_result: ...
|
||||
def chmod(self, mode: int) -> None: ...
|
||||
@@ -99,7 +99,7 @@ class Path(PurePath):
|
||||
def iterdir(self: Self) -> Generator[Self, None, None]: ...
|
||||
def lchmod(self, mode: int) -> None: ...
|
||||
def lstat(self) -> stat_result: ...
|
||||
def mkdir(self, mode: int = ..., parents: bool = ..., exist_ok: bool = ...) -> None: ...
|
||||
def mkdir(self, mode: int = 511, parents: bool = False, exist_ok: bool = False) -> None: ...
|
||||
# Adapted from builtins.open
|
||||
# Text mode: always returns a TextIOWrapper
|
||||
# The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this.
|
||||
@@ -171,16 +171,16 @@ class Path(PurePath):
|
||||
def rename(self, target: str | PurePath) -> None: ...
|
||||
def replace(self, target: str | PurePath) -> None: ...
|
||||
|
||||
def resolve(self: Self, strict: bool = ...) -> Self: ...
|
||||
def resolve(self: Self, strict: bool = False) -> Self: ...
|
||||
def rglob(self: Self, pattern: str) -> Generator[Self, None, None]: ...
|
||||
def rmdir(self) -> None: ...
|
||||
def symlink_to(self, target: str | Path, target_is_directory: bool = ...) -> None: ...
|
||||
def symlink_to(self, target: str | Path, target_is_directory: bool = False) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def hardlink_to(self, target: str | Path) -> None: ...
|
||||
|
||||
def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
def touch(self, mode: int = 438, exist_ok: bool = True) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def unlink(self, missing_ok: bool = ...) -> None: ...
|
||||
def unlink(self, missing_ok: bool = False) -> None: ...
|
||||
else:
|
||||
def unlink(self) -> None: ...
|
||||
|
||||
@@ -189,12 +189,12 @@ class Path(PurePath):
|
||||
def absolute(self: Self) -> Self: ...
|
||||
def expanduser(self: Self) -> Self: ...
|
||||
def read_bytes(self) -> bytes: ...
|
||||
def read_text(self, encoding: str | None = ..., errors: str | None = ...) -> str: ...
|
||||
def read_text(self, encoding: str | None = None, errors: str | None = None) -> str: ...
|
||||
def samefile(self, other_path: StrPath) -> bool: ...
|
||||
def write_bytes(self, data: ReadableBuffer) -> int: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def write_text(
|
||||
self, data: str, encoding: str | None = ..., errors: str | None = ..., newline: str | None = ...
|
||||
self, data: str, encoding: str | None = None, errors: str | None = None, newline: str | None = None
|
||||
) -> int: ...
|
||||
else:
|
||||
def write_text(self, data: str, encoding: str | None = ..., errors: str | None = ...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user