@@ -140,10 +140,16 @@ class _dok_base(_spbase[_SCT, _ShapeT_co], IndexMixin[_SCT, _ShapeT_co], dict[Sh
140
140
copy : bool = False ,
141
141
maxprint : int | None = None ,
142
142
) -> None : ...
143
+ @override
144
+ def todok (self , / , copy : bool = False ) -> Self : ...
143
145
144
146
#
145
- @override
146
- def __delitem__ (self , key : onp .ToJustInt , / ) -> None : ...
147
+ @overload
148
+ def __delitem__ (self : _dok_base [Any , _2D ], key : _ToKey2D , / ) -> None : ...
149
+ @overload
150
+ def __delitem__ (self : _dok_base [Any , _1D ], key : _ToKey1D , / ) -> None : ...
151
+ @overload
152
+ def __delitem__ (self , key : _ToKey1D | _ToKey2D , / ) -> None : ...
147
153
148
154
#
149
155
@override
@@ -165,62 +171,60 @@ class _dok_base(_spbase[_SCT, _ShapeT_co], IndexMixin[_SCT, _ShapeT_co], dict[Sh
165
171
166
172
#
167
173
@overload
168
- def setdefault (self : _dok_base [Any , _1D ], key : _ToKey1D , default : None = None , / ) -> _SCT | None : ...
174
+ def setdefault (self : _dok_base [Any , _2D ], key : _ToKey2D , default : _T , / ) -> _SCT | _T : ...
169
175
@overload
170
176
def setdefault (self : _dok_base [Any , _2D ], key : _ToKey2D , default : None = None , / ) -> _SCT | None : ...
171
177
@overload
172
- def setdefault (self , key : _ToKey1D | _ToKey2D , default : None = None , / ) -> _SCT | None : ...
173
- @overload
174
178
def setdefault (self : _dok_base [Any , _1D ], key : _ToKey1D , default : _T , / ) -> _SCT | _T : ...
175
179
@overload
176
- def setdefault (self : _dok_base [Any , _2D ], key : _ToKey2D , default : _T , / ) -> _SCT | _T : ...
180
+ def setdefault (self : _dok_base [Any , _1D ], key : _ToKey1D , default : None = None , / ) -> _SCT | None : ...
177
181
@overload
178
182
def setdefault (self , key : _ToKey1D | _ToKey2D , default : _T , / ) -> _SCT | _T : ...
183
+ @overload
184
+ def setdefault (self , key : _ToKey1D | _ToKey2D , default : None = None , / ) -> _SCT | None : ...
179
185
180
186
#
181
187
@overload
182
- def get (self : _dok_base [Any , _1D ], key : _ToKey1D , / , default : float = 0.0 ) -> _SCT | float : ...
188
+ def get (self : _dok_base [Any , _2D ], key : _ToKey2D , / , default : _T ) -> _SCT | _T : ...
183
189
@overload
184
190
def get (self : _dok_base [Any , _2D ], key : _ToKey2D , / , default : float = 0.0 ) -> _SCT | float : ...
185
191
@overload
186
- def get (self , key : _ToKey1D | _ToKey2D , / , default : float = 0.0 ) -> _SCT | float : ...
187
- @overload
188
192
def get (self : _dok_base [Any , _1D ], key : _ToKey1D , / , default : _T ) -> _SCT | _T : ...
189
193
@overload
190
- def get (self : _dok_base [Any , _2D ], key : _ToKey2D , / , default : _T ) -> _SCT | _T : ...
194
+ def get (self : _dok_base [Any , _1D ], key : _ToKey1D , / , default : float = 0.0 ) -> _SCT | float : ...
191
195
@overload
192
196
def get (self , key : _ToKey1D | _ToKey2D , / , default : _T ) -> _SCT | _T : ...
197
+ @overload
198
+ def get (self , key : _ToKey1D | _ToKey2D , / , default : float = 0.0 ) -> _SCT | float : ...
193
199
194
200
#
195
201
def conjtransp (self , / ) -> Self : ...
196
202
197
203
#
198
204
@overload
199
205
@classmethod
200
- def fromkeys (cls : type [_dok_base [np .bool_ , _1D ]], ks : _ToKeys1D , v : onp .ToBool , / ) -> _dok_base [np .bool_ , _1D ]: ...
206
+ def fromkeys (cls : type [_dok_base [_SCT , _2D ]], ks : _ToKeys2D , v : _SCT , / ) -> _dok_base [_SCT , _2D ]: ...
207
+ @overload
208
+ @classmethod
209
+ def fromkeys (cls : type [_dok_base [_SCT , _1D ]], ks : _ToKeys1D , v : _SCT , / ) -> _dok_base [_SCT , _1D ]: ...
201
210
@overload
202
211
@classmethod
203
212
def fromkeys (cls : type [_dok_base [np .bool_ , _2D ]], ks : _ToKeys2D , v : onp .ToBool , / ) -> _dok_base [np .bool_ , _2D ]: ...
204
213
@overload
205
214
@classmethod
206
- def fromkeys (cls : type [_dok_base [np .int_ , _1D ]], ks : _ToKeys1D , v : opt . JustInt = 1 , / ) -> _dok_base [np .int_ , _1D ]: ...
215
+ def fromkeys (cls : type [_dok_base [np .bool_ , _1D ]], ks : _ToKeys1D , v : onp . ToBool , / ) -> _dok_base [np .bool_ , _1D ]: ...
207
216
@overload
208
217
@classmethod
209
218
def fromkeys (cls : type [_dok_base [np .int_ , _2D ]], ks : _ToKeys2D , v : opt .JustInt = 1 , / ) -> _dok_base [np .int_ , _2D ]: ...
210
219
@overload
211
220
@classmethod
212
- def fromkeys (cls : type [_dok_base [np .float64 , _1D ]], ks : _ToKeys1D , v : opt .JustFloat , / ) -> _dok_base [np .float64 , _1D ]: ...
221
+ def fromkeys (cls : type [_dok_base [np .int_ , _1D ]], ks : _ToKeys1D , v : opt .JustInt = 1 , / ) -> _dok_base [np .int_ , _1D ]: ...
213
222
@overload
214
223
@classmethod
215
224
def fromkeys (cls : type [_dok_base [np .float64 , _2D ]], ks : _ToKeys2D , v : opt .JustFloat , / ) -> _dok_base [np .float64 , _2D ]: ...
216
225
@overload
217
226
@classmethod
218
- def fromkeys (
219
- cls : type [_dok_base [np .complex128 , _1D ]],
220
- ks : _ToKeys1D ,
221
- v : opt .JustComplex ,
222
- / ,
223
- ) -> _dok_base [np .complex128 , _1D ]: ...
227
+ def fromkeys (cls : type [_dok_base [np .float64 , _1D ]], ks : _ToKeys1D , v : opt .JustFloat , / ) -> _dok_base [np .float64 , _1D ]: ...
224
228
@overload
225
229
@classmethod
226
230
def fromkeys (
@@ -231,41 +235,41 @@ class _dok_base(_spbase[_SCT, _ShapeT_co], IndexMixin[_SCT, _ShapeT_co], dict[Sh
231
235
) -> _dok_base [np .complex128 , _2D ]: ...
232
236
@overload
233
237
@classmethod
234
- def fromkeys (cls : type [_dok_base [_SCT , _1D ]], ks : _ToKeys1D , v : _SCT , / ) -> _dok_base [_SCT , _1D ]: ...
235
- @overload
236
- @classmethod
237
- def fromkeys (cls : type [_dok_base [_SCT , _2D ]], ks : _ToKeys2D , v : _SCT , / ) -> _dok_base [_SCT , _2D ]: ...
238
+ def fromkeys (
239
+ cls : type [_dok_base [np .complex128 , _1D ]],
240
+ ks : _ToKeys1D ,
241
+ v : opt .JustComplex ,
242
+ / ,
243
+ ) -> _dok_base [np .complex128 , _1D ]: ...
238
244
239
245
#
240
246
class dok_array (_dok_base [_SCT , _ShapeT_co ], sparray , Generic [_SCT , _ShapeT_co ]):
241
247
# NOTE: This horrible code duplication is required due to the lack of higher-kinded typing (HKT) support.
242
248
# https://github.com/python/typing/issues/548
243
249
@overload
244
250
@classmethod
245
- def fromkeys (cls : type [dok_array [np .bool_ , _1D ]], ks : _ToKeys1D , v : onp .ToBool , / ) -> dok_array [np .bool_ , _1D ]: ...
251
+ def fromkeys (cls : type [dok_array [_SCT , _2D ]], ks : _ToKeys2D , v : _SCT , / ) -> dok_array [_SCT , _2D ]: ...
252
+ @overload
253
+ @classmethod
254
+ def fromkeys (cls : type [dok_array [_SCT , _1D ]], ks : _ToKeys1D , v : _SCT , / ) -> dok_array [_SCT , _1D ]: ...
246
255
@overload
247
256
@classmethod
248
257
def fromkeys (cls : type [dok_array [np .bool_ , _2D ]], ks : _ToKeys2D , v : onp .ToBool , / ) -> dok_array [np .bool_ , _2D ]: ...
249
258
@overload
250
259
@classmethod
251
- def fromkeys (cls : type [dok_array [np .int_ , _1D ]], ks : _ToKeys1D , v : opt . JustInt = 1 , / ) -> dok_array [np .int_ , _1D ]: ...
260
+ def fromkeys (cls : type [dok_array [np .bool_ , _1D ]], ks : _ToKeys1D , v : onp . ToBool , / ) -> dok_array [np .bool_ , _1D ]: ...
252
261
@overload
253
262
@classmethod
254
263
def fromkeys (cls : type [dok_array [np .int_ , _2D ]], ks : _ToKeys2D , v : opt .JustInt = 1 , / ) -> dok_array [np .int_ , _2D ]: ...
255
264
@overload
256
265
@classmethod
257
- def fromkeys (cls : type [dok_array [np .float64 , _1D ]], ks : _ToKeys1D , v : opt .JustFloat , / ) -> dok_array [np .float64 , _1D ]: ...
266
+ def fromkeys (cls : type [dok_array [np .int_ , _1D ]], ks : _ToKeys1D , v : opt .JustInt = 1 , / ) -> dok_array [np .int_ , _1D ]: ...
258
267
@overload
259
268
@classmethod
260
269
def fromkeys (cls : type [dok_array [np .float64 , _2D ]], ks : _ToKeys2D , v : opt .JustFloat , / ) -> dok_array [np .float64 , _2D ]: ...
261
270
@overload
262
271
@classmethod
263
- def fromkeys (
264
- cls : type [dok_array [np .complex128 , _1D ]],
265
- ks : _ToKeys1D ,
266
- v : opt .JustComplex ,
267
- / ,
268
- ) -> dok_array [np .complex128 , _1D ]: ...
272
+ def fromkeys (cls : type [dok_array [np .float64 , _1D ]], ks : _ToKeys1D , v : opt .JustFloat , / ) -> dok_array [np .float64 , _1D ]: ...
269
273
@overload
270
274
@classmethod
271
275
def fromkeys (
@@ -276,10 +280,12 @@ class dok_array(_dok_base[_SCT, _ShapeT_co], sparray, Generic[_SCT, _ShapeT_co])
276
280
) -> dok_array [np .complex128 , _2D ]: ...
277
281
@overload
278
282
@classmethod
279
- def fromkeys (cls : type [dok_array [_SCT , _1D ]], ks : _ToKeys1D , v : _SCT , / ) -> dok_array [_SCT , _1D ]: ...
280
- @overload
281
- @classmethod
282
- def fromkeys (cls : type [dok_array [_SCT , _2D ]], ks : _ToKeys2D , v : _SCT , / ) -> dok_array [_SCT , _2D ]: ...
283
+ def fromkeys (
284
+ cls : type [dok_array [np .complex128 , _1D ]],
285
+ ks : _ToKeys1D ,
286
+ v : opt .JustComplex ,
287
+ / ,
288
+ ) -> dok_array [np .complex128 , _1D ]: ...
283
289
284
290
#
285
291
class dok_matrix (_dok_base [_SCT , _2D ], spmatrix [_SCT ], Generic [_SCT ]):
@@ -291,6 +297,9 @@ class dok_matrix(_dok_base[_SCT, _2D], spmatrix[_SCT], Generic[_SCT]):
291
297
#
292
298
@overload
293
299
@classmethod
300
+ def fromkeys (cls , ks : _ToKeys2D , v : _SCT , / ) -> Self : ...
301
+ @overload
302
+ @classmethod
294
303
def fromkeys (cls : type [dok_matrix [np .bool_ ]], ks : _ToKeys2D , v : onp .ToBool , / ) -> dok_matrix [np .bool_ ]: ...
295
304
@overload
296
305
@classmethod
@@ -301,9 +310,6 @@ class dok_matrix(_dok_base[_SCT, _2D], spmatrix[_SCT], Generic[_SCT]):
301
310
@overload
302
311
@classmethod
303
312
def fromkeys (cls : type [dok_matrix [np .complex128 ]], ks : _ToKeys2D , v : opt .JustComplex , / ) -> dok_matrix [np .complex128 ]: ...
304
- @overload
305
- @classmethod
306
- def fromkeys (cls , ks : _ToKeys2D , v : _SCT , / ) -> Self : ...
307
313
308
314
#
309
315
def isspmatrix_dok (x : object ) -> TypeIs [dok_matrix ]: ...
0 commit comments