File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ from typing import (
13
13
overload ,
14
14
Protocol ,
15
15
)
16
+ from typing_extensions import deprecated
16
17
17
18
from numpy import (
18
19
ndarray ,
@@ -129,11 +130,29 @@ def load(
129
130
encoding : L ["ASCII" , "latin1" , "bytes" ] = ...,
130
131
) -> Any : ...
131
132
133
+ @overload
132
134
def save (
133
135
file : str | os .PathLike [str ] | _SupportsWrite [bytes ],
134
136
arr : ArrayLike ,
135
137
allow_pickle : bool = ...,
136
- fix_imports : bool = ...,
138
+ ) -> None : ...
139
+ @overload
140
+ @deprecated ("The 'fix_imports' flag is deprecated in NumPy 2.1." )
141
+ def save (
142
+ file : str | os .PathLike [str ] | _SupportsWrite [bytes ],
143
+ arr : ArrayLike ,
144
+ allow_pickle : bool = ...,
145
+ * ,
146
+ fix_imports : bool ,
147
+ ) -> None : ...
148
+ @overload
149
+ @deprecated ("The 'fix_imports' flag is deprecated in NumPy 2.1." )
150
+ def save (
151
+ file : str | os .PathLike [str ] | _SupportsWrite [bytes ],
152
+ arr : ArrayLike ,
153
+ allow_pickle : bool ,
154
+ fix_imports : bool ,
155
+ / ,
137
156
) -> None : ...
138
157
139
158
def savez (
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ AR_i8: npt.NDArray[np.int64]
12
12
13
13
np .load (str_file ) # E: incompatible type
14
14
15
- np .save (bytes_path , AR_i8 ) # E: incompatible type
15
+ np .save (bytes_path , AR_i8 ) # E: No overload variant
16
+ # https://github.com/python/mypy/issues/16111
17
+ # np.save(str_path, AR_i8, fix_imports=True) # W: deprecated
16
18
17
19
np .savez (bytes_path , AR_i8 ) # E: incompatible type
18
20
You can’t perform that action at this time.
0 commit comments