@@ -5,7 +5,9 @@ from _typeshed import (
5
5
OpenBinaryModeUpdating ,
6
6
OpenBinaryModeWriting ,
7
7
OpenTextMode ,
8
+ ReadableBuffer ,
8
9
Self ,
10
+ StrOrBytesPath ,
9
11
StrPath ,
10
12
)
11
13
from collections .abc import Callable , Generator , Iterator , Sequence
@@ -188,16 +190,16 @@ class Path(PurePath):
188
190
def expanduser (self : Self ) -> Self : ...
189
191
def read_bytes (self ) -> bytes : ...
190
192
def read_text (self , encoding : str | None = ..., errors : str | None = ...) -> str : ...
191
- def samefile (self , other_path : str | bytes | int | Path ) -> bool : ...
192
- def write_bytes (self , data : bytes ) -> int : ...
193
+ def samefile (self , other_path : StrPath ) -> bool : ...
194
+ def write_bytes (self , data : ReadableBuffer ) -> int : ...
193
195
if sys .version_info >= (3 , 10 ):
194
196
def write_text (
195
197
self , data : str , encoding : str | None = ..., errors : str | None = ..., newline : str | None = ...
196
198
) -> int : ...
197
199
else :
198
200
def write_text (self , data : str , encoding : str | None = ..., errors : str | None = ...) -> int : ...
199
- if sys .version_info >= (3 , 8 ):
200
- def link_to (self , target : StrPath | bytes ) -> None : ...
201
+ if sys .version_info >= (3 , 8 ) and sys . version_info < ( 3 , 12 ) :
202
+ def link_to (self , target : StrOrBytesPath ) -> None : ...
201
203
if sys .version_info >= (3 , 12 ):
202
204
def walk (
203
205
self : Self , top_down : bool = ..., on_error : Callable [[OSError ], object ] | None = ..., follow_symlinks : bool = ...
0 commit comments