@@ -35,7 +35,7 @@ from numpy import (
35
35
complexfloating ,
36
36
complex128 ,
37
37
)
38
- from ._nbit import _NBitInt , _NBitDouble
38
+ from ._nbit import _NBitInt
39
39
from ._scalars import (
40
40
_BoolLike_co ,
41
41
_IntLike_co ,
@@ -121,7 +121,7 @@ class _BoolDivMod(Protocol):
121
121
@overload # platform dependent
122
122
def __call__ (self , other : int , / ) -> _2Tuple [int_ ]: ...
123
123
@overload
124
- def __call__ (self , other : float , / ) -> _2Tuple [floating [ _NBit1 | _NBitDouble ] ]: ...
124
+ def __call__ (self , other : float , / ) -> _2Tuple [np . float64 ]: ...
125
125
@overload
126
126
def __call__ (self , other : _IntType , / ) -> _2Tuple [_IntType ]: ...
127
127
@overload
@@ -139,34 +139,34 @@ class _IntTrueDiv(Protocol[_NBit1]):
139
139
@overload
140
140
def __call__ (self , other : bool , / ) -> floating [_NBit1 ]: ...
141
141
@overload
142
- def __call__ (self , other : int , / ) -> floating [_NBit1 | _NBitInt ]: ...
142
+ def __call__ (self , other : int , / ) -> floating [_NBit1 ] | floating [ _NBitInt ]: ...
143
143
@overload
144
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
144
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
145
145
@overload
146
146
def __call__ (
147
- self , other : complex , / ,
148
- ) -> complexfloating [_NBit1 | _NBitDouble , _NBit1 | _NBitDouble ] : ...
147
+ self , other : complex , /
148
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complex128 : ...
149
149
@overload
150
- def __call__ (self , other : integer [_NBit2 ], / ) -> floating [_NBit1 | _NBit2 ]: ...
150
+ def __call__ (
151
+ self , other : integer [_NBit2 ], /
152
+ ) -> floating [_NBit1 ] | floating [_NBit2 ]: ...
151
153
152
154
class _UnsignedIntOp (Protocol [_NBit1 ]):
153
155
# NOTE: `uint64 + signedinteger -> float64`
154
156
@overload
155
157
def __call__ (self , other : bool , / ) -> unsignedinteger [_NBit1 ]: ...
156
158
@overload
157
- def __call__ (
158
- self , other : int | signedinteger [Any ], /
159
- ) -> Any : ...
159
+ def __call__ (self , other : int | signedinteger [Any ], / ) -> Any : ...
160
160
@overload
161
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
161
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
162
162
@overload
163
163
def __call__ (
164
- self , other : complex , / ,
165
- ) -> complexfloating [_NBit1 | _NBitDouble , _NBit1 | _NBitDouble ] : ...
164
+ self , other : complex , /
165
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complex128 : ...
166
166
@overload
167
167
def __call__ (
168
168
self , other : unsignedinteger [_NBit2 ], /
169
- ) -> unsignedinteger [_NBit1 | _NBit2 ]: ...
169
+ ) -> unsignedinteger [_NBit1 ] | unsignedinteger [ _NBit2 ]: ...
170
170
171
171
class _UnsignedIntBitOp (Protocol [_NBit1 ]):
172
172
@overload
@@ -178,135 +178,137 @@ class _UnsignedIntBitOp(Protocol[_NBit1]):
178
178
@overload
179
179
def __call__ (
180
180
self , other : unsignedinteger [_NBit2 ], /
181
- ) -> unsignedinteger [_NBit1 | _NBit2 ]: ...
181
+ ) -> unsignedinteger [_NBit1 ] | unsignedinteger [ _NBit2 ]: ...
182
182
183
183
class _UnsignedIntMod (Protocol [_NBit1 ]):
184
184
@overload
185
185
def __call__ (self , other : bool , / ) -> unsignedinteger [_NBit1 ]: ...
186
186
@overload
187
- def __call__ (
188
- self , other : int | signedinteger [Any ], /
189
- ) -> Any : ...
187
+ def __call__ (self , other : int | signedinteger [Any ], / ) -> Any : ...
190
188
@overload
191
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
189
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
192
190
@overload
193
191
def __call__ (
194
192
self , other : unsignedinteger [_NBit2 ], /
195
- ) -> unsignedinteger [_NBit1 | _NBit2 ]: ...
193
+ ) -> unsignedinteger [_NBit1 ] | unsignedinteger [ _NBit2 ]: ...
196
194
197
195
class _UnsignedIntDivMod (Protocol [_NBit1 ]):
198
196
@overload
199
197
def __call__ (self , other : bool , / ) -> _2Tuple [signedinteger [_NBit1 ]]: ...
200
198
@overload
201
- def __call__ (
202
- self , other : int | signedinteger [Any ], /
203
- ) -> _2Tuple [Any ]: ...
199
+ def __call__ (self , other : int | signedinteger [Any ], / ) -> _2Tuple [Any ]: ...
204
200
@overload
205
- def __call__ (self , other : float , / ) -> _2Tuple [floating [_NBit1 | _NBitDouble ] ]: ...
201
+ def __call__ (self , other : float , / ) -> _2Tuple [floating [_NBit1 ]] | _2Tuple [ float64 ]: ...
206
202
@overload
207
203
def __call__ (
208
204
self , other : unsignedinteger [_NBit2 ], /
209
- ) -> _2Tuple [unsignedinteger [_NBit1 | _NBit2 ]]: ...
205
+ ) -> _2Tuple [unsignedinteger [_NBit1 ]] | _2Tuple [ unsignedinteger [ _NBit2 ]]: ...
210
206
211
207
class _SignedIntOp (Protocol [_NBit1 ]):
212
208
@overload
213
209
def __call__ (self , other : bool , / ) -> signedinteger [_NBit1 ]: ...
214
210
@overload
215
- def __call__ (self , other : int , / ) -> signedinteger [_NBit1 | _NBitInt ] : ...
211
+ def __call__ (self , other : int , / ) -> signedinteger [_NBit1 ] | int_ : ...
216
212
@overload
217
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
213
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
218
214
@overload
219
215
def __call__ (
220
- self , other : complex , / ,
221
- ) -> complexfloating [_NBit1 | _NBitDouble , _NBit1 | _NBitDouble ] : ...
216
+ self , other : complex , /
217
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complex128 : ...
222
218
@overload
223
219
def __call__ (
224
- self , other : signedinteger [_NBit2 ], / ,
225
- ) -> signedinteger [_NBit1 | _NBit2 ]: ...
220
+ self , other : signedinteger [_NBit2 ], /
221
+ ) -> signedinteger [_NBit1 ] | signedinteger [ _NBit2 ]: ...
226
222
227
223
class _SignedIntBitOp (Protocol [_NBit1 ]):
228
224
@overload
229
225
def __call__ (self , other : bool , / ) -> signedinteger [_NBit1 ]: ...
230
226
@overload
231
- def __call__ (self , other : int , / ) -> signedinteger [_NBit1 | _NBitInt ] : ...
227
+ def __call__ (self , other : int , / ) -> signedinteger [_NBit1 ] | int_ : ...
232
228
@overload
233
229
def __call__ (
234
- self , other : signedinteger [_NBit2 ], / ,
235
- ) -> signedinteger [_NBit1 | _NBit2 ]: ...
230
+ self , other : signedinteger [_NBit2 ], /
231
+ ) -> signedinteger [_NBit1 ] | signedinteger [ _NBit2 ]: ...
236
232
237
233
class _SignedIntMod (Protocol [_NBit1 ]):
238
234
@overload
239
235
def __call__ (self , other : bool , / ) -> signedinteger [_NBit1 ]: ...
240
236
@overload
241
- def __call__ (self , other : int , / ) -> signedinteger [_NBit1 | _NBitInt ] : ...
237
+ def __call__ (self , other : int , / ) -> signedinteger [_NBit1 ] | int_ : ...
242
238
@overload
243
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
239
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
244
240
@overload
245
241
def __call__ (
246
- self , other : signedinteger [_NBit2 ], / ,
247
- ) -> signedinteger [_NBit1 | _NBit2 ]: ...
242
+ self , other : signedinteger [_NBit2 ], /
243
+ ) -> signedinteger [_NBit1 ] | signedinteger [ _NBit2 ]: ...
248
244
249
245
class _SignedIntDivMod (Protocol [_NBit1 ]):
250
246
@overload
251
247
def __call__ (self , other : bool , / ) -> _2Tuple [signedinteger [_NBit1 ]]: ...
252
248
@overload
253
- def __call__ (self , other : int , / ) -> _2Tuple [signedinteger [_NBit1 | _NBitInt ] ]: ...
249
+ def __call__ (self , other : int , / ) -> _2Tuple [signedinteger [_NBit1 ]] | _2Tuple [ int_ ]: ...
254
250
@overload
255
- def __call__ (self , other : float , / ) -> _2Tuple [floating [_NBit1 | _NBitDouble ] ]: ...
251
+ def __call__ (self , other : float , / ) -> _2Tuple [floating [_NBit1 ]] | _2Tuple [ float64 ]: ...
256
252
@overload
257
253
def __call__ (
258
- self , other : signedinteger [_NBit2 ], / ,
259
- ) -> _2Tuple [signedinteger [_NBit1 | _NBit2 ]]: ...
254
+ self , other : signedinteger [_NBit2 ], /
255
+ ) -> _2Tuple [signedinteger [_NBit1 ]] | _2Tuple [ signedinteger [ _NBit2 ]]: ...
260
256
261
257
class _FloatOp (Protocol [_NBit1 ]):
262
258
@overload
263
259
def __call__ (self , other : bool , / ) -> floating [_NBit1 ]: ...
264
260
@overload
265
- def __call__ (self , other : int , / ) -> floating [_NBit1 | _NBitInt ]: ...
261
+ def __call__ (self , other : int , / ) -> floating [_NBit1 ] | floating [ _NBitInt ]: ...
266
262
@overload
267
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
263
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
268
264
@overload
269
265
def __call__ (
270
- self , other : complex , / ,
271
- ) -> complexfloating [_NBit1 | _NBitDouble , _NBit1 | _NBitDouble ] : ...
266
+ self , other : complex , /
267
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complex128 : ...
272
268
@overload
273
269
def __call__ (
274
270
self , other : integer [_NBit2 ] | floating [_NBit2 ], /
275
- ) -> floating [_NBit1 | _NBit2 ]: ...
271
+ ) -> floating [_NBit1 ] | floating [ _NBit2 ]: ...
276
272
277
273
class _FloatMod (Protocol [_NBit1 ]):
278
274
@overload
279
275
def __call__ (self , other : bool , / ) -> floating [_NBit1 ]: ...
280
276
@overload
281
- def __call__ (self , other : int , / ) -> floating [_NBit1 | _NBitInt ]: ...
277
+ def __call__ (self , other : int , / ) -> floating [_NBit1 ] | floating [ _NBitInt ]: ...
282
278
@overload
283
- def __call__ (self , other : float , / ) -> floating [_NBit1 | _NBitDouble ] : ...
279
+ def __call__ (self , other : float , / ) -> floating [_NBit1 ] | float64 : ...
284
280
@overload
285
281
def __call__ (
286
282
self , other : integer [_NBit2 ] | floating [_NBit2 ], /
287
- ) -> floating [_NBit1 | _NBit2 ]: ...
283
+ ) -> floating [_NBit1 ] | floating [ _NBit2 ]: ...
288
284
289
285
class _FloatDivMod (Protocol [_NBit1 ]):
290
286
@overload
291
287
def __call__ (self , other : bool , / ) -> _2Tuple [floating [_NBit1 ]]: ...
292
288
@overload
293
- def __call__ (self , other : int , / ) -> _2Tuple [floating [_NBit1 | _NBitInt ]]: ...
289
+ def __call__ (
290
+ self , other : int , /
291
+ ) -> _2Tuple [floating [_NBit1 ]] | _2Tuple [floating [_NBitInt ]]: ...
294
292
@overload
295
- def __call__ (self , other : float , / ) -> _2Tuple [floating [_NBit1 | _NBitDouble ]]: ...
293
+ def __call__ (
294
+ self , other : float , /
295
+ ) -> _2Tuple [floating [_NBit1 ]] | _2Tuple [float64 ]: ...
296
296
@overload
297
297
def __call__ (
298
298
self , other : integer [_NBit2 ] | floating [_NBit2 ], /
299
- ) -> _2Tuple [floating [_NBit1 | _NBit2 ]]: ...
299
+ ) -> _2Tuple [floating [_NBit1 ]] | _2Tuple [ floating [ _NBit2 ]]: ...
300
300
301
301
class _ComplexOp (Protocol [_NBit1 ]):
302
302
@overload
303
303
def __call__ (self , other : bool , / ) -> complexfloating [_NBit1 , _NBit1 ]: ...
304
304
@overload
305
- def __call__ (self , other : int , / ) -> complexfloating [_NBit1 | _NBitInt , _NBit1 | _NBitInt ]: ...
305
+ def __call__ (
306
+ self , other : int , /
307
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complexfloating [_NBitInt , _NBitInt ]: ...
306
308
@overload
307
309
def __call__ (
308
310
self , other : complex , / ,
309
- ) -> complexfloating [_NBit1 | _NBitDouble , _NBit1 | _NBitDouble ] : ...
311
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complex128 : ...
310
312
@overload
311
313
def __call__ (
312
314
self ,
@@ -315,7 +317,7 @@ class _ComplexOp(Protocol[_NBit1]):
315
317
| floating [_NBit2 ]
316
318
| complexfloating [_NBit2 , _NBit2 ]
317
319
), / ,
318
- ) -> complexfloating [_NBit1 | _NBit2 , _NBit1 | _NBit2 ]: ...
320
+ ) -> complexfloating [_NBit1 , _NBit1 ] | complexfloating [ _NBit2 , _NBit2 ]: ...
319
321
320
322
class _NumberOp (Protocol ):
321
323
def __call__ (self , other : _NumberLike_co , / ) -> Any : ...
0 commit comments