@@ -11,12 +11,14 @@ from numpy import (
11
11
int16 ,
12
12
int32 ,
13
13
int64 ,
14
+ int_ ,
14
15
long ,
15
- ulong ,
16
16
uint8 ,
17
17
uint16 ,
18
18
uint32 ,
19
19
uint64 ,
20
+ uint ,
21
+ ulong ,
20
22
)
21
23
from numpy .random .bit_generator import BitGenerator
22
24
from numpy ._typing import (
@@ -34,6 +36,7 @@ from numpy._typing import (
34
36
_Int16Codes ,
35
37
_Int32Codes ,
36
38
_Int64Codes ,
39
+ _IntCodes ,
37
40
_LongCodes ,
38
41
_ShapeLike ,
39
42
_SingleCodes ,
@@ -42,6 +45,7 @@ from numpy._typing import (
42
45
_UInt16Codes ,
43
46
_UInt32Codes ,
44
47
_UInt64Codes ,
48
+ _UIntCodes ,
45
49
_ULongCodes ,
46
50
)
47
51
@@ -114,6 +118,7 @@ class RandomState:
114
118
self ,
115
119
low : int ,
116
120
high : None | int = ...,
121
+ size : None = ...,
117
122
) -> int : ...
118
123
@overload
119
124
def randint ( # type: ignore[misc]
@@ -124,6 +129,14 @@ class RandomState:
124
129
dtype : type [bool ] = ...,
125
130
) -> bool : ...
126
131
@overload
132
+ def randint ( # type: ignore[misc]
133
+ self ,
134
+ low : int ,
135
+ high : None | int = ...,
136
+ size : None = ...,
137
+ dtype : type [np .bool ] = ...,
138
+ ) -> np .bool : ...
139
+ @overload
127
140
def randint ( # type: ignore[misc]
128
141
self ,
129
142
low : int ,
@@ -132,6 +145,102 @@ class RandomState:
132
145
dtype : type [int ] = ...,
133
146
) -> int : ...
134
147
@overload
148
+ def randint ( # type: ignore[misc]
149
+ self ,
150
+ low : int ,
151
+ high : None | int = ...,
152
+ size : None = ...,
153
+ dtype : dtype [uint8 ] | type [uint8 ] | _UInt8Codes | _SupportsDType [dtype [uint8 ]] = ...,
154
+ ) -> uint8 : ...
155
+ @overload
156
+ def randint ( # type: ignore[misc]
157
+ self ,
158
+ low : int ,
159
+ high : None | int = ...,
160
+ size : None = ...,
161
+ dtype : dtype [uint16 ] | type [uint16 ] | _UInt16Codes | _SupportsDType [dtype [uint16 ]] = ...,
162
+ ) -> uint16 : ...
163
+ @overload
164
+ def randint ( # type: ignore[misc]
165
+ self ,
166
+ low : int ,
167
+ high : None | int = ...,
168
+ size : None = ...,
169
+ dtype : dtype [uint32 ] | type [uint32 ] | _UInt32Codes | _SupportsDType [dtype [uint32 ]] = ...,
170
+ ) -> uint32 : ...
171
+ @overload
172
+ def randint ( # type: ignore[misc]
173
+ self ,
174
+ low : int ,
175
+ high : None | int = ...,
176
+ size : None = ...,
177
+ dtype : dtype [uint ] | type [uint ] | _UIntCodes | _SupportsDType [dtype [uint ]] = ...,
178
+ ) -> uint : ...
179
+ @overload
180
+ def randint ( # type: ignore[misc]
181
+ self ,
182
+ low : int ,
183
+ high : None | int = ...,
184
+ size : None = ...,
185
+ dtype : dtype [ulong ] | type [ulong ] | _ULongCodes | _SupportsDType [dtype [ulong ]] = ...,
186
+ ) -> ulong : ...
187
+ @overload
188
+ def randint ( # type: ignore[misc]
189
+ self ,
190
+ low : int ,
191
+ high : None | int = ...,
192
+ size : None = ...,
193
+ dtype : dtype [uint64 ] | type [uint64 ] | _UInt64Codes | _SupportsDType [dtype [uint64 ]] = ...,
194
+ ) -> uint64 : ...
195
+ @overload
196
+ def randint ( # type: ignore[misc]
197
+ self ,
198
+ low : int ,
199
+ high : None | int = ...,
200
+ size : None = ...,
201
+ dtype : dtype [int8 ] | type [int8 ] | _Int8Codes | _SupportsDType [dtype [int8 ]] = ...,
202
+ ) -> int8 : ...
203
+ @overload
204
+ def randint ( # type: ignore[misc]
205
+ self ,
206
+ low : int ,
207
+ high : None | int = ...,
208
+ size : None = ...,
209
+ dtype : dtype [int16 ] | type [int16 ] | _Int16Codes | _SupportsDType [dtype [int16 ]] = ...,
210
+ ) -> int16 : ...
211
+ @overload
212
+ def randint ( # type: ignore[misc]
213
+ self ,
214
+ low : int ,
215
+ high : None | int = ...,
216
+ size : None = ...,
217
+ dtype : dtype [int32 ] | type [int32 ] | _Int32Codes | _SupportsDType [dtype [int32 ]] = ...,
218
+ ) -> int32 : ...
219
+ @overload
220
+ def randint ( # type: ignore[misc]
221
+ self ,
222
+ low : int ,
223
+ high : None | int = ...,
224
+ size : None = ...,
225
+ dtype : dtype [int_ ] | type [int_ ] | _IntCodes | _SupportsDType [dtype [int_ ]] = ...,
226
+ ) -> int_ : ...
227
+ @overload
228
+ def randint ( # type: ignore[misc]
229
+ self ,
230
+ low : int ,
231
+ high : None | int = ...,
232
+ size : None = ...,
233
+ dtype : dtype [long ] | type [long ] | _LongCodes | _SupportsDType [dtype [long ]] = ...,
234
+ ) -> long : ...
235
+ @overload
236
+ def randint ( # type: ignore[misc]
237
+ self ,
238
+ low : int ,
239
+ high : None | int = ...,
240
+ size : None = ...,
241
+ dtype : dtype [int64 ] | type [int64 ] | _Int64Codes | _SupportsDType [dtype [int64 ]] = ...,
242
+ ) -> int64 : ...
243
+ @overload
135
244
def randint ( # type: ignore[misc]
136
245
self ,
137
246
low : _ArrayLikeInt_co ,
0 commit comments