@@ -11,8 +11,8 @@ from numpy import (
11
11
int16 ,
12
12
int32 ,
13
13
int64 ,
14
- int_ ,
15
- uint ,
14
+ long ,
15
+ ulong ,
16
16
uint8 ,
17
17
uint16 ,
18
18
uint32 ,
@@ -107,7 +107,8 @@ class RandomState:
107
107
@overload
108
108
def tomaxint (self , size : None = ...) -> int : ... # type: ignore[misc]
109
109
@overload
110
- def tomaxint (self , size : _ShapeLike ) -> NDArray [int_ ]: ...
110
+ # Generates long values, but stores it in a 64bit int:
111
+ def tomaxint (self , size : _ShapeLike ) -> NDArray [int64 ]: ...
111
112
@overload
112
113
def randint ( # type: ignore[misc]
113
114
self ,
@@ -120,23 +121,23 @@ class RandomState:
120
121
low : int ,
121
122
high : None | int = ...,
122
123
size : None = ...,
123
- dtype : _DTypeLikeBool = ...,
124
+ dtype : type [ bool ] = ...,
124
125
) -> bool : ...
125
126
@overload
126
127
def randint ( # type: ignore[misc]
127
128
self ,
128
129
low : int ,
129
130
high : None | int = ...,
130
131
size : None = ...,
131
- dtype : _DTypeLikeInt | _DTypeLikeUInt = ...,
132
+ dtype : type [ int ] = ...,
132
133
) -> int : ...
133
134
@overload
134
135
def randint ( # type: ignore[misc]
135
136
self ,
136
137
low : _ArrayLikeInt_co ,
137
138
high : None | _ArrayLikeInt_co = ...,
138
139
size : None | _ShapeLike = ...,
139
- ) -> NDArray [int_ ]: ...
140
+ ) -> NDArray [long ]: ...
140
141
@overload
141
142
def randint ( # type: ignore[misc]
142
143
self ,
@@ -215,16 +216,16 @@ class RandomState:
215
216
low : _ArrayLikeInt_co ,
216
217
high : None | _ArrayLikeInt_co = ...,
217
218
size : None | _ShapeLike = ...,
218
- dtype : dtype [int_ ] | type [int ] | type [int_ ] | _IntCodes | _SupportsDType [dtype [int_ ]] = ...,
219
- ) -> NDArray [int_ ]: ...
219
+ dtype : dtype [long ] | type [int ] | type [long ] | _LongCodes | _SupportsDType [dtype [long ]] = ...,
220
+ ) -> NDArray [long ]: ...
220
221
@overload
221
222
def randint ( # type: ignore[misc]
222
223
self ,
223
224
low : _ArrayLikeInt_co ,
224
225
high : None | _ArrayLikeInt_co = ...,
225
226
size : None | _ShapeLike = ...,
226
- dtype : dtype [uint ] | type [uint ] | _UIntCodes | _SupportsDType [dtype [uint ]] = ...,
227
- ) -> NDArray [uint ]: ...
227
+ dtype : dtype [ulong ] | type [ulong ] | _ULongCodes | _SupportsDType [dtype [ulong ]] = ...,
228
+ ) -> NDArray [ulong ]: ...
228
229
def bytes (self , length : int ) -> builtins .bytes : ...
229
230
@overload
230
231
def choice (
@@ -241,7 +242,7 @@ class RandomState:
241
242
size : _ShapeLike = ...,
242
243
replace : bool = ...,
243
244
p : None | _ArrayLikeFloat_co = ...,
244
- ) -> NDArray [int_ ]: ...
245
+ ) -> NDArray [long ]: ...
245
246
@overload
246
247
def choice (
247
248
self ,
@@ -283,7 +284,7 @@ class RandomState:
283
284
low : _ArrayLikeInt_co ,
284
285
high : None | _ArrayLikeInt_co = ...,
285
286
size : None | _ShapeLike = ...,
286
- ) -> NDArray [int_ ]: ...
287
+ ) -> NDArray [long ]: ...
287
288
@overload
288
289
def standard_normal (self , size : None = ...) -> float : ... # type: ignore[misc]
289
290
@overload
@@ -449,31 +450,31 @@ class RandomState:
449
450
@overload
450
451
def binomial (
451
452
self , n : _ArrayLikeInt_co , p : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
452
- ) -> NDArray [int_ ]: ...
453
+ ) -> NDArray [long ]: ...
453
454
@overload
454
455
def negative_binomial (self , n : float , p : float , size : None = ...) -> int : ... # type: ignore[misc]
455
456
@overload
456
457
def negative_binomial (
457
458
self , n : _ArrayLikeFloat_co , p : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
458
- ) -> NDArray [int_ ]: ...
459
+ ) -> NDArray [long ]: ...
459
460
@overload
460
461
def poisson (self , lam : float = ..., size : None = ...) -> int : ... # type: ignore[misc]
461
462
@overload
462
463
def poisson (
463
464
self , lam : _ArrayLikeFloat_co = ..., size : None | _ShapeLike = ...
464
- ) -> NDArray [int_ ]: ...
465
+ ) -> NDArray [long ]: ...
465
466
@overload
466
467
def zipf (self , a : float , size : None = ...) -> int : ... # type: ignore[misc]
467
468
@overload
468
469
def zipf (
469
470
self , a : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
470
- ) -> NDArray [int_ ]: ...
471
+ ) -> NDArray [long ]: ...
471
472
@overload
472
473
def geometric (self , p : float , size : None = ...) -> int : ... # type: ignore[misc]
473
474
@overload
474
475
def geometric (
475
476
self , p : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
476
- ) -> NDArray [int_ ]: ...
477
+ ) -> NDArray [long ]: ...
477
478
@overload
478
479
def hypergeometric (self , ngood : int , nbad : int , nsample : int , size : None = ...) -> int : ... # type: ignore[misc]
479
480
@overload
@@ -483,13 +484,13 @@ class RandomState:
483
484
nbad : _ArrayLikeInt_co ,
484
485
nsample : _ArrayLikeInt_co ,
485
486
size : None | _ShapeLike = ...,
486
- ) -> NDArray [int_ ]: ...
487
+ ) -> NDArray [long ]: ...
487
488
@overload
488
489
def logseries (self , p : float , size : None = ...) -> int : ... # type: ignore[misc]
489
490
@overload
490
491
def logseries (
491
492
self , p : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
492
- ) -> NDArray [int_ ]: ...
493
+ ) -> NDArray [long ]: ...
493
494
def multivariate_normal (
494
495
self ,
495
496
mean : _ArrayLikeFloat_co ,
@@ -500,13 +501,13 @@ class RandomState:
500
501
) -> NDArray [float64 ]: ...
501
502
def multinomial (
502
503
self , n : _ArrayLikeInt_co , pvals : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
503
- ) -> NDArray [int_ ]: ...
504
+ ) -> NDArray [long ]: ...
504
505
def dirichlet (
505
506
self , alpha : _ArrayLikeFloat_co , size : None | _ShapeLike = ...
506
507
) -> NDArray [float64 ]: ...
507
508
def shuffle (self , x : ArrayLike ) -> None : ...
508
509
@overload
509
- def permutation (self , x : int ) -> NDArray [int_ ]: ...
510
+ def permutation (self , x : int ) -> NDArray [long ]: ...
510
511
@overload
511
512
def permutation (self , x : ArrayLike ) -> NDArray [Any ]: ...
512
513
0 commit comments