basedpyright 1.12.6 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
- package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
- package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
- package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
- package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
- package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
- package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
- package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
- package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
- package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
- package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
- package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
- package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
- package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
- package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
- package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
- package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
- package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
- package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
- package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
- package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
- package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
- package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
- package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
- package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
- package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
- package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
- package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
- package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
- package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
- package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
- package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
- package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
- package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
- package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
- package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
- package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
- package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
- package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
- package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
- package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
- package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
- package/package.json +1 -1
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Operator interface.
|
|
3
|
+
|
|
4
|
+
This module exports a set of functions implemented in C corresponding
|
|
5
|
+
to the intrinsic operators of Python. For example, operator.add(x, y)
|
|
6
|
+
is equivalent to the expression x+y. The function names are those
|
|
7
|
+
used for special methods; variants without leading and trailing
|
|
8
|
+
'__' are also provided for convenience.
|
|
9
|
+
"""
|
|
10
|
+
|
|
1
11
|
import sys
|
|
2
12
|
from _typeshed import SupportsGetItem
|
|
3
13
|
from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence
|
|
@@ -42,58 +52,159 @@ class _SupportsPos(Protocol[_T_co]):
|
|
|
42
52
|
def __pos__(self) -> _T_co: ...
|
|
43
53
|
|
|
44
54
|
# All four comparison functions must have the same signature, or we get false-positive errors
|
|
45
|
-
def lt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def
|
|
76
|
-
|
|
55
|
+
def lt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any:
|
|
56
|
+
"""Same as a < b."""
|
|
57
|
+
...
|
|
58
|
+
def le(a: _SupportsComparison, b: _SupportsComparison, /) -> Any:
|
|
59
|
+
"""Same as a <= b."""
|
|
60
|
+
...
|
|
61
|
+
def eq(a: object, b: object, /) -> Any:
|
|
62
|
+
"""Same as a == b."""
|
|
63
|
+
...
|
|
64
|
+
def ne(a: object, b: object, /) -> Any:
|
|
65
|
+
"""Same as a != b."""
|
|
66
|
+
...
|
|
67
|
+
def ge(a: _SupportsComparison, b: _SupportsComparison, /) -> Any:
|
|
68
|
+
"""Same as a >= b."""
|
|
69
|
+
...
|
|
70
|
+
def gt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any:
|
|
71
|
+
"""Same as a > b."""
|
|
72
|
+
...
|
|
73
|
+
def not_(a: object, /) -> bool:
|
|
74
|
+
"""Same as not a."""
|
|
75
|
+
...
|
|
76
|
+
def truth(a: object, /) -> bool:
|
|
77
|
+
"""Return True if a is true, False otherwise."""
|
|
78
|
+
...
|
|
79
|
+
def is_(a: object, b: object, /) -> bool:
|
|
80
|
+
"""Same as a is b."""
|
|
81
|
+
...
|
|
82
|
+
def is_not(a: object, b: object, /) -> bool:
|
|
83
|
+
"""Same as a is not b."""
|
|
84
|
+
...
|
|
85
|
+
def abs(a: SupportsAbs[_T], /) -> _T:
|
|
86
|
+
"""Same as abs(a)."""
|
|
87
|
+
...
|
|
88
|
+
def add(a: Any, b: Any, /) -> Any:
|
|
89
|
+
"""Same as a + b."""
|
|
90
|
+
...
|
|
91
|
+
def and_(a: Any, b: Any, /) -> Any:
|
|
92
|
+
"""Same as a & b."""
|
|
93
|
+
...
|
|
94
|
+
def floordiv(a: Any, b: Any, /) -> Any:
|
|
95
|
+
"""Same as a // b."""
|
|
96
|
+
...
|
|
97
|
+
def index(a: SupportsIndex, /) -> int:
|
|
98
|
+
"""Same as a.__index__()"""
|
|
99
|
+
...
|
|
100
|
+
def inv(a: _SupportsInversion[_T_co], /) -> _T_co:
|
|
101
|
+
"""Same as ~a."""
|
|
102
|
+
...
|
|
103
|
+
def invert(a: _SupportsInversion[_T_co], /) -> _T_co:
|
|
104
|
+
"""Same as ~a."""
|
|
105
|
+
...
|
|
106
|
+
def lshift(a: Any, b: Any, /) -> Any:
|
|
107
|
+
"""Same as a << b."""
|
|
108
|
+
...
|
|
109
|
+
def mod(a: Any, b: Any, /) -> Any:
|
|
110
|
+
"""Same as a % b."""
|
|
111
|
+
...
|
|
112
|
+
def mul(a: Any, b: Any, /) -> Any:
|
|
113
|
+
"""Same as a * b."""
|
|
114
|
+
...
|
|
115
|
+
def matmul(a: Any, b: Any, /) -> Any:
|
|
116
|
+
"""Same as a @ b."""
|
|
117
|
+
...
|
|
118
|
+
def neg(a: _SupportsNeg[_T_co], /) -> _T_co:
|
|
119
|
+
"""Same as -a."""
|
|
120
|
+
...
|
|
121
|
+
def or_(a: Any, b: Any, /) -> Any:
|
|
122
|
+
"""Same as a | b."""
|
|
123
|
+
...
|
|
124
|
+
def pos(a: _SupportsPos[_T_co], /) -> _T_co:
|
|
125
|
+
"""Same as +a."""
|
|
126
|
+
...
|
|
127
|
+
def pow(a: Any, b: Any, /) -> Any:
|
|
128
|
+
"""Same as a ** b."""
|
|
129
|
+
...
|
|
130
|
+
def rshift(a: Any, b: Any, /) -> Any:
|
|
131
|
+
"""Same as a >> b."""
|
|
132
|
+
...
|
|
133
|
+
def sub(a: Any, b: Any, /) -> Any:
|
|
134
|
+
"""Same as a - b."""
|
|
135
|
+
...
|
|
136
|
+
def truediv(a: Any, b: Any, /) -> Any:
|
|
137
|
+
"""Same as a / b."""
|
|
138
|
+
...
|
|
139
|
+
def xor(a: Any, b: Any, /) -> Any:
|
|
140
|
+
"""Same as a ^ b."""
|
|
141
|
+
...
|
|
142
|
+
def concat(a: Sequence[_T], b: Sequence[_T], /) -> Sequence[_T]:
|
|
143
|
+
"""Same as a + b, for a and b sequences."""
|
|
144
|
+
...
|
|
145
|
+
def contains(a: Container[object], b: object, /) -> bool:
|
|
146
|
+
"""Same as b in a (note reversed operands)."""
|
|
147
|
+
...
|
|
148
|
+
def countOf(a: Iterable[object], b: object, /) -> int:
|
|
149
|
+
"""Return the number of times b occurs in a."""
|
|
150
|
+
...
|
|
77
151
|
@overload
|
|
78
|
-
def delitem(a: MutableSequence[Any], b: SupportsIndex, /) -> None:
|
|
152
|
+
def delitem(a: MutableSequence[Any], b: SupportsIndex, /) -> None:
|
|
153
|
+
"""Same as del a[b]."""
|
|
154
|
+
...
|
|
79
155
|
@overload
|
|
80
|
-
def delitem(a: MutableSequence[Any], b: slice, /) -> None:
|
|
156
|
+
def delitem(a: MutableSequence[Any], b: slice, /) -> None:
|
|
157
|
+
"""Same as del a[b]."""
|
|
158
|
+
...
|
|
81
159
|
@overload
|
|
82
|
-
def delitem(a: MutableMapping[_K, Any], b: _K, /) -> None:
|
|
160
|
+
def delitem(a: MutableMapping[_K, Any], b: _K, /) -> None:
|
|
161
|
+
"""Same as del a[b]."""
|
|
162
|
+
...
|
|
83
163
|
@overload
|
|
84
|
-
def getitem(a: Sequence[_T], b: slice, /) -> Sequence[_T]:
|
|
164
|
+
def getitem(a: Sequence[_T], b: slice, /) -> Sequence[_T]:
|
|
165
|
+
"""Same as a[b]."""
|
|
166
|
+
...
|
|
85
167
|
@overload
|
|
86
|
-
def getitem(a: SupportsGetItem[_K, _V], b: _K, /) -> _V:
|
|
87
|
-
|
|
168
|
+
def getitem(a: SupportsGetItem[_K, _V], b: _K, /) -> _V:
|
|
169
|
+
"""Same as a[b]."""
|
|
170
|
+
...
|
|
171
|
+
def indexOf(a: Iterable[_T], b: _T, /) -> int:
|
|
172
|
+
"""Return the first index of b in a."""
|
|
173
|
+
...
|
|
88
174
|
@overload
|
|
89
|
-
def setitem(a: MutableSequence[_T], b: SupportsIndex, c: _T, /) -> None:
|
|
175
|
+
def setitem(a: MutableSequence[_T], b: SupportsIndex, c: _T, /) -> None:
|
|
176
|
+
"""Same as a[b] = c."""
|
|
177
|
+
...
|
|
90
178
|
@overload
|
|
91
|
-
def setitem(a: MutableSequence[_T], b: slice, c: Sequence[_T], /) -> None:
|
|
179
|
+
def setitem(a: MutableSequence[_T], b: slice, c: Sequence[_T], /) -> None:
|
|
180
|
+
"""Same as a[b] = c."""
|
|
181
|
+
...
|
|
92
182
|
@overload
|
|
93
|
-
def setitem(a: MutableMapping[_K, _V], b: _K, c: _V, /) -> None:
|
|
94
|
-
|
|
183
|
+
def setitem(a: MutableMapping[_K, _V], b: _K, c: _V, /) -> None:
|
|
184
|
+
"""Same as a[b] = c."""
|
|
185
|
+
...
|
|
186
|
+
def length_hint(obj: object, default: int = 0, /) -> int:
|
|
187
|
+
"""
|
|
188
|
+
Return an estimate of the number of items in obj.
|
|
189
|
+
|
|
190
|
+
This is useful for presizing containers when building from an iterable.
|
|
191
|
+
|
|
192
|
+
If the object supports len(), the result will be exact.
|
|
193
|
+
Otherwise, it may over- or under-estimate by an arbitrary amount.
|
|
194
|
+
The result will be an integer >= 0.
|
|
195
|
+
"""
|
|
196
|
+
...
|
|
95
197
|
@final
|
|
96
198
|
class attrgetter(Generic[_T_co]):
|
|
199
|
+
"""
|
|
200
|
+
attrgetter(attr, ...) --> attrgetter object
|
|
201
|
+
|
|
202
|
+
Return a callable object that fetches the given attribute(s) from its operand.
|
|
203
|
+
After f = attrgetter('name'), the call f(r) returns r.name.
|
|
204
|
+
After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
|
|
205
|
+
After h = attrgetter('name.first', 'name.last'), the call h(r) returns
|
|
206
|
+
(r.name.first, r.name.last).
|
|
207
|
+
"""
|
|
97
208
|
@overload
|
|
98
209
|
def __new__(cls, attr: str, /) -> attrgetter[Any]: ...
|
|
99
210
|
@overload
|
|
@@ -104,10 +215,19 @@ class attrgetter(Generic[_T_co]):
|
|
|
104
215
|
def __new__(cls, attr: str, attr2: str, attr3: str, attr4: str, /) -> attrgetter[tuple[Any, Any, Any, Any]]: ...
|
|
105
216
|
@overload
|
|
106
217
|
def __new__(cls, attr: str, /, *attrs: str) -> attrgetter[tuple[Any, ...]]: ...
|
|
107
|
-
def __call__(self, obj: Any, /) -> _T_co:
|
|
218
|
+
def __call__(self, obj: Any, /) -> _T_co:
|
|
219
|
+
"""Call self as a function."""
|
|
220
|
+
...
|
|
108
221
|
|
|
109
222
|
@final
|
|
110
223
|
class itemgetter(Generic[_T_co]):
|
|
224
|
+
"""
|
|
225
|
+
itemgetter(item, ...) --> itemgetter object
|
|
226
|
+
|
|
227
|
+
Return a callable object that fetches the given item(s) from its operand.
|
|
228
|
+
After f = itemgetter(2), the call f(r) returns r[2].
|
|
229
|
+
After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
|
|
230
|
+
"""
|
|
111
231
|
@overload
|
|
112
232
|
def __new__(cls, item: _T, /) -> itemgetter[_T]: ...
|
|
113
233
|
@overload
|
|
@@ -119,29 +239,85 @@ class itemgetter(Generic[_T_co]):
|
|
|
119
239
|
#
|
|
120
240
|
# A suspected mypy issue prevents using [..., _T] instead of [..., Any] here.
|
|
121
241
|
# https://github.com/python/mypy/issues/14032
|
|
122
|
-
def __call__(self, obj: SupportsGetItem[Any, Any]) -> Any:
|
|
242
|
+
def __call__(self, obj: SupportsGetItem[Any, Any]) -> Any:
|
|
243
|
+
"""Call self as a function."""
|
|
244
|
+
...
|
|
123
245
|
|
|
124
246
|
@final
|
|
125
247
|
class methodcaller:
|
|
248
|
+
"""
|
|
249
|
+
methodcaller(name, ...) --> methodcaller object
|
|
250
|
+
|
|
251
|
+
Return a callable object that calls the given method on its operand.
|
|
252
|
+
After f = methodcaller('name'), the call f(r) returns r.name().
|
|
253
|
+
After g = methodcaller('name', 'date', foo=1), the call g(r) returns
|
|
254
|
+
r.name('date', foo=1).
|
|
255
|
+
"""
|
|
126
256
|
def __init__(self, name: str, /, *args: Any, **kwargs: Any) -> None: ...
|
|
127
|
-
def __call__(self, obj: Any) -> Any:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
def
|
|
141
|
-
|
|
142
|
-
|
|
257
|
+
def __call__(self, obj: Any) -> Any:
|
|
258
|
+
"""Call self as a function."""
|
|
259
|
+
...
|
|
260
|
+
|
|
261
|
+
def iadd(a: Any, b: Any, /) -> Any:
|
|
262
|
+
"""Same as a += b."""
|
|
263
|
+
...
|
|
264
|
+
def iand(a: Any, b: Any, /) -> Any:
|
|
265
|
+
"""Same as a &= b."""
|
|
266
|
+
...
|
|
267
|
+
def iconcat(a: Any, b: Any, /) -> Any:
|
|
268
|
+
"""Same as a += b, for a and b sequences."""
|
|
269
|
+
...
|
|
270
|
+
def ifloordiv(a: Any, b: Any, /) -> Any:
|
|
271
|
+
"""Same as a //= b."""
|
|
272
|
+
...
|
|
273
|
+
def ilshift(a: Any, b: Any, /) -> Any:
|
|
274
|
+
"""Same as a <<= b."""
|
|
275
|
+
...
|
|
276
|
+
def imod(a: Any, b: Any, /) -> Any:
|
|
277
|
+
"""Same as a %= b."""
|
|
278
|
+
...
|
|
279
|
+
def imul(a: Any, b: Any, /) -> Any:
|
|
280
|
+
"""Same as a *= b."""
|
|
281
|
+
...
|
|
282
|
+
def imatmul(a: Any, b: Any, /) -> Any:
|
|
283
|
+
"""Same as a @= b."""
|
|
284
|
+
...
|
|
285
|
+
def ior(a: Any, b: Any, /) -> Any:
|
|
286
|
+
"""Same as a |= b."""
|
|
287
|
+
...
|
|
288
|
+
def ipow(a: Any, b: Any, /) -> Any:
|
|
289
|
+
"""Same as a **= b."""
|
|
290
|
+
...
|
|
291
|
+
def irshift(a: Any, b: Any, /) -> Any:
|
|
292
|
+
"""Same as a >>= b."""
|
|
293
|
+
...
|
|
294
|
+
def isub(a: Any, b: Any, /) -> Any:
|
|
295
|
+
"""Same as a -= b."""
|
|
296
|
+
...
|
|
297
|
+
def itruediv(a: Any, b: Any, /) -> Any:
|
|
298
|
+
"""Same as a /= b."""
|
|
299
|
+
...
|
|
300
|
+
def ixor(a: Any, b: Any, /) -> Any:
|
|
301
|
+
"""Same as a ^= b."""
|
|
302
|
+
...
|
|
143
303
|
|
|
144
304
|
if sys.version_info >= (3, 11):
|
|
145
|
-
def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R:
|
|
305
|
+
def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R:
|
|
306
|
+
"""Same as obj(*args, **kwargs)."""
|
|
307
|
+
...
|
|
308
|
+
|
|
309
|
+
def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool:
|
|
310
|
+
"""
|
|
311
|
+
Return 'a == b'.
|
|
312
|
+
|
|
313
|
+
This function uses an approach designed to prevent
|
|
314
|
+
timing analysis, making it appropriate for cryptography.
|
|
315
|
+
|
|
316
|
+
a and b must both be of the same type: either str (ASCII only),
|
|
317
|
+
or any bytes-like object.
|
|
146
318
|
|
|
147
|
-
|
|
319
|
+
Note: If a and b are of different lengths, or if an error occurs,
|
|
320
|
+
a timing attack could theoretically reveal information about the
|
|
321
|
+
types and lengths of a and b--but not their values.
|
|
322
|
+
"""
|
|
323
|
+
...
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""A POSIX helper for the subprocess module."""
|
|
2
|
+
|
|
1
3
|
import sys
|
|
2
4
|
from _typeshed import StrOrBytesPath
|
|
3
5
|
from collections.abc import Callable, Sequence
|
|
@@ -30,4 +32,26 @@ if sys.platform != "win32":
|
|
|
30
32
|
preexec_fn: Callable[[], None],
|
|
31
33
|
allow_vfork: bool,
|
|
32
34
|
/,
|
|
33
|
-
) -> int:
|
|
35
|
+
) -> int:
|
|
36
|
+
"""
|
|
37
|
+
fork_exec(args, executable_list, close_fds, cwd, env,
|
|
38
|
+
p2cread, p2cwrite, c2pread, c2pwrite,
|
|
39
|
+
errread, errwrite, errpipe_read, errpipe_write,
|
|
40
|
+
restore_signals, call_setsid, preexec_fn)
|
|
41
|
+
|
|
42
|
+
Forks a child process, closes parent file descriptors as appropriate in the
|
|
43
|
+
child and dups the few that are needed before calling exec() in the child
|
|
44
|
+
process.
|
|
45
|
+
|
|
46
|
+
The preexec_fn, if supplied, will be called immediately before exec.
|
|
47
|
+
WARNING: preexec_fn is NOT SAFE if your application uses threads.
|
|
48
|
+
It may trigger infrequent, difficult to debug deadlocks.
|
|
49
|
+
|
|
50
|
+
If an error occurs in the child process before the exec, it is
|
|
51
|
+
serialized and written to the errpipe_write fd per subprocess.py.
|
|
52
|
+
|
|
53
|
+
Returns: the child process's PID.
|
|
54
|
+
|
|
55
|
+
Raises: Only on an error in the parent process.
|
|
56
|
+
"""
|
|
57
|
+
...
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
+
"""Module implements the Mersenne Twister random number generator."""
|
|
2
|
+
|
|
1
3
|
from typing_extensions import TypeAlias
|
|
2
4
|
|
|
3
5
|
# Actually Tuple[(int,) * 625]
|
|
4
6
|
_State: TypeAlias = tuple[int, ...]
|
|
5
7
|
|
|
6
8
|
class Random:
|
|
9
|
+
"""Random() -> create a random number generator with its own internal state."""
|
|
7
10
|
def __init__(self, seed: object = ...) -> None: ...
|
|
8
|
-
def seed(self, n: object = None, /) -> None:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
def seed(self, n: object = None, /) -> None:
|
|
12
|
+
"""
|
|
13
|
+
seed([n]) -> None.
|
|
14
|
+
|
|
15
|
+
Defaults to use urandom and falls back to a combination
|
|
16
|
+
of the current time and the process identifier.
|
|
17
|
+
"""
|
|
18
|
+
...
|
|
19
|
+
def getstate(self) -> _State:
|
|
20
|
+
"""getstate() -> tuple containing the current state."""
|
|
21
|
+
...
|
|
22
|
+
def setstate(self, state: _State, /) -> None:
|
|
23
|
+
"""setstate(state) -> None. Restores generator state."""
|
|
24
|
+
...
|
|
25
|
+
def random(self) -> float:
|
|
26
|
+
"""random() -> x in the interval [0, 1)."""
|
|
27
|
+
...
|
|
28
|
+
def getrandbits(self, k: int, /) -> int:
|
|
29
|
+
"""getrandbits(k) -> x. Generates an int with k random bits."""
|
|
30
|
+
...
|