@@ -4,11 +4,9 @@ from collections.abc import Iterator, Sequence
4
4
from io import TextIOWrapper
5
5
from os import PathLike
6
6
from typing import IO , Literal , TypeVar , overload
7
- from typing_extensions import Self , TypeAlias
7
+ from typing_extensions import Self
8
8
from zipfile import ZipFile
9
9
10
- _ReadWriteBinaryMode : TypeAlias = Literal ["r" , "w" , "rb" , "wb" ]
11
-
12
10
_ZF = TypeVar ("_ZF" , bound = ZipFile )
13
11
14
12
if sys .version_info >= (3 , 12 ):
@@ -39,42 +37,29 @@ if sys.version_info >= (3, 12):
39
37
def name (self ) -> str : ...
40
38
@property
41
39
def parent (self ) -> PathLike [str ]: ... # undocumented
42
- if sys .version_info >= (3 , 10 ):
43
- @property
44
- def filename (self ) -> PathLike [str ]: ... # undocumented
45
- if sys .version_info >= (3 , 11 ):
46
- @property
47
- def suffix (self ) -> str : ...
48
- @property
49
- def suffixes (self ) -> list [str ]: ...
50
- @property
51
- def stem (self ) -> str : ...
52
-
53
- if sys .version_info >= (3 , 9 ):
54
- @overload
55
- def open (
56
- self ,
57
- mode : Literal ["r" , "w" ] = "r" ,
58
- encoding : str | None = None ,
59
- errors : str | None = None ,
60
- newline : str | None = None ,
61
- line_buffering : bool = ...,
62
- write_through : bool = ...,
63
- * ,
64
- pwd : bytes | None = None ,
65
- ) -> TextIOWrapper : ...
66
- @overload
67
- def open (self , mode : Literal ["rb" , "wb" ], * , pwd : bytes | None = None ) -> IO [bytes ]: ...
68
- else :
69
- def open (
70
- self , mode : _ReadWriteBinaryMode = "r" , pwd : bytes | None = None , * , force_zip64 : bool = False
71
- ) -> IO [bytes ]: ...
72
-
73
- if sys .version_info >= (3 , 10 ):
74
- def iterdir (self ) -> Iterator [Self ]: ...
75
- else :
76
- def iterdir (self ) -> Iterator [Path ]: ...
77
-
40
+ @property
41
+ def filename (self ) -> PathLike [str ]: ... # undocumented
42
+ @property
43
+ def suffix (self ) -> str : ...
44
+ @property
45
+ def suffixes (self ) -> list [str ]: ...
46
+ @property
47
+ def stem (self ) -> str : ...
48
+ @overload
49
+ def open (
50
+ self ,
51
+ mode : Literal ["r" , "w" ] = "r" ,
52
+ encoding : str | None = None ,
53
+ errors : str | None = None ,
54
+ newline : str | None = None ,
55
+ line_buffering : bool = ...,
56
+ write_through : bool = ...,
57
+ * ,
58
+ pwd : bytes | None = None ,
59
+ ) -> TextIOWrapper : ...
60
+ @overload
61
+ def open (self , mode : Literal ["rb" , "wb" ], * , pwd : bytes | None = None ) -> IO [bytes ]: ...
62
+ def iterdir (self ) -> Iterator [Self ]: ...
78
63
def is_dir (self ) -> bool : ...
79
64
def is_file (self ) -> bool : ...
80
65
def exists (self ) -> bool : ...
@@ -87,17 +72,12 @@ if sys.version_info >= (3, 12):
87
72
write_through : bool = ...,
88
73
) -> str : ...
89
74
def read_bytes (self ) -> bytes : ...
90
- if sys .version_info >= (3 , 10 ):
91
- def joinpath (self , * other : StrPath ) -> Path : ...
92
- else :
93
- def joinpath (self , add : StrPath ) -> Path : ... # undocumented
94
- if sys .version_info >= (3 , 12 ):
95
- def glob (self , pattern : str ) -> Iterator [Self ]: ...
96
- def rglob (self , pattern : str ) -> Iterator [Self ]: ...
97
- def is_symlink (self ) -> Literal [False ]: ...
98
- def relative_to (self , other : Path , * extra : StrPath ) -> str : ...
99
- def match (self , path_pattern : str ) -> bool : ...
100
- def __eq__ (self , other : object ) -> bool : ...
101
- def __hash__ (self ) -> int : ...
102
-
75
+ def joinpath (self , * other : StrPath ) -> Path : ...
76
+ def glob (self , pattern : str ) -> Iterator [Self ]: ...
77
+ def rglob (self , pattern : str ) -> Iterator [Self ]: ...
78
+ def is_symlink (self ) -> Literal [False ]: ...
79
+ def relative_to (self , other : Path , * extra : StrPath ) -> str : ...
80
+ def match (self , path_pattern : str ) -> bool : ...
81
+ def __eq__ (self , other : object ) -> bool : ...
82
+ def __hash__ (self ) -> int : ...
103
83
def __truediv__ (self , add : StrPath ) -> Path : ...
0 commit comments