mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Improve types and bytes usage of pathlib (#9016)
This commit is contained in:
@@ -5,7 +5,9 @@ from _typeshed import (
|
||||
OpenBinaryModeUpdating,
|
||||
OpenBinaryModeWriting,
|
||||
OpenTextMode,
|
||||
ReadableBuffer,
|
||||
Self,
|
||||
StrOrBytesPath,
|
||||
StrPath,
|
||||
)
|
||||
from collections.abc import Callable, Generator, Iterator, Sequence
|
||||
@@ -188,16 +190,16 @@ class Path(PurePath):
|
||||
def expanduser(self: Self) -> Self: ...
|
||||
def read_bytes(self) -> bytes: ...
|
||||
def read_text(self, encoding: str | None = ..., errors: str | None = ...) -> str: ...
|
||||
def samefile(self, other_path: str | bytes | int | Path) -> bool: ...
|
||||
def write_bytes(self, data: bytes) -> int: ...
|
||||
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 = ...
|
||||
) -> int: ...
|
||||
else:
|
||||
def write_text(self, data: str, encoding: str | None = ..., errors: str | None = ...) -> int: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def link_to(self, target: StrPath | bytes) -> None: ...
|
||||
if sys.version_info >= (3, 8) and sys.version_info < (3, 12):
|
||||
def link_to(self, target: StrOrBytesPath) -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def walk(
|
||||
self: Self, top_down: bool = ..., on_error: Callable[[OSError], object] | None = ..., follow_symlinks: bool = ...
|
||||
|
||||
Reference in New Issue
Block a user