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.
Files changed (60) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
  6. package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
  7. package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
  8. package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
  9. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
  12. package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
  13. package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
  14. package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
  15. package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
  16. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
  17. package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
  18. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
  19. package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
  20. package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
  21. package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
  22. package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
  23. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
  24. package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
  25. package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
  26. package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
  27. package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
  28. package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
  29. package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
  30. package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
  31. package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
  32. package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
  33. package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
  34. package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
  35. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
  36. package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
  37. package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
  38. package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
  39. package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
  40. package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
  41. package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
  42. package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
  43. package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
  44. package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
  45. package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
  46. package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
  47. package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
  48. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
  49. package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
  50. package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
  51. package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
  52. package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
  53. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
  54. package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
  55. package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
  56. package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
  57. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
  58. package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
  59. package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
  60. package/package.json +1 -1
@@ -1,3 +1,8 @@
1
+ """
2
+ This module provides access to the mathematical functions
3
+ defined by the C standard.
4
+ """
5
+
1
6
  import sys
2
7
  from collections.abc import Iterable
3
8
  from typing import Protocol, SupportsFloat, SupportsIndex, TypeVar, overload
@@ -14,115 +19,406 @@ inf: float
14
19
  nan: float
15
20
  tau: float
16
21
 
17
- def acos(x: _SupportsFloatOrIndex, /) -> float: ...
18
- def acosh(x: _SupportsFloatOrIndex, /) -> float: ...
19
- def asin(x: _SupportsFloatOrIndex, /) -> float: ...
20
- def asinh(x: _SupportsFloatOrIndex, /) -> float: ...
21
- def atan(x: _SupportsFloatOrIndex, /) -> float: ...
22
- def atan2(y: _SupportsFloatOrIndex, x: _SupportsFloatOrIndex, /) -> float: ...
23
- def atanh(x: _SupportsFloatOrIndex, /) -> float: ...
22
+ def acos(x: _SupportsFloatOrIndex, /) -> float:
23
+ """Return the arc cosine (measured in radians) of x."""
24
+ ...
25
+ def acosh(x: _SupportsFloatOrIndex, /) -> float:
26
+ """Return the inverse hyperbolic cosine of x."""
27
+ ...
28
+ def asin(x: _SupportsFloatOrIndex, /) -> float:
29
+ """Return the arc sine (measured in radians) of x."""
30
+ ...
31
+ def asinh(x: _SupportsFloatOrIndex, /) -> float:
32
+ """Return the inverse hyperbolic sine of x."""
33
+ ...
34
+ def atan(x: _SupportsFloatOrIndex, /) -> float:
35
+ """Return the arc tangent (measured in radians) of x."""
36
+ ...
37
+ def atan2(y: _SupportsFloatOrIndex, x: _SupportsFloatOrIndex, /) -> float:
38
+ """
39
+ Return the arc tangent (measured in radians) of y/x.
40
+
41
+ Unlike atan(y/x), the signs of both x and y are considered.
42
+ """
43
+ ...
44
+ def atanh(x: _SupportsFloatOrIndex, /) -> float:
45
+ """Return the inverse hyperbolic tangent of x."""
46
+ ...
24
47
 
25
48
  if sys.version_info >= (3, 11):
26
- def cbrt(x: _SupportsFloatOrIndex, /) -> float: ...
49
+ def cbrt(x: _SupportsFloatOrIndex, /) -> float:
50
+ """Return the cube root of x."""
51
+ ...
27
52
 
28
53
  class _SupportsCeil(Protocol[_T_co]):
29
54
  def __ceil__(self) -> _T_co: ...
30
55
 
31
56
  @overload
32
- def ceil(x: _SupportsCeil[_T], /) -> _T: ...
57
+ def ceil(x: _SupportsCeil[_T], /) -> _T:
58
+ """
59
+ Return the ceiling of x as an Integral.
60
+
61
+ This is the smallest integer >= x.
62
+ """
63
+ ...
33
64
  @overload
34
- def ceil(x: _SupportsFloatOrIndex, /) -> int: ...
35
- def comb(n: SupportsIndex, k: SupportsIndex, /) -> int: ...
36
- def copysign(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
37
- def cos(x: _SupportsFloatOrIndex, /) -> float: ...
38
- def cosh(x: _SupportsFloatOrIndex, /) -> float: ...
39
- def degrees(x: _SupportsFloatOrIndex, /) -> float: ...
40
- def dist(p: Iterable[_SupportsFloatOrIndex], q: Iterable[_SupportsFloatOrIndex], /) -> float: ...
41
- def erf(x: _SupportsFloatOrIndex, /) -> float: ...
42
- def erfc(x: _SupportsFloatOrIndex, /) -> float: ...
43
- def exp(x: _SupportsFloatOrIndex, /) -> float: ...
65
+ def ceil(x: _SupportsFloatOrIndex, /) -> int:
66
+ """
67
+ Return the ceiling of x as an Integral.
68
+
69
+ This is the smallest integer >= x.
70
+ """
71
+ ...
72
+ def comb(n: SupportsIndex, k: SupportsIndex, /) -> int:
73
+ """
74
+ Number of ways to choose k items from n items without repetition and without order.
75
+
76
+ Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates
77
+ to zero when k > n.
78
+
79
+ Also called the binomial coefficient because it is equivalent
80
+ to the coefficient of k-th term in polynomial expansion of the
81
+ expression (1 + x)**n.
82
+
83
+ Raises TypeError if either of the arguments are not integers.
84
+ Raises ValueError if either of the arguments are negative.
85
+ """
86
+ ...
87
+ def copysign(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float:
88
+ """
89
+ Return a float with the magnitude (absolute value) of x but the sign of y.
90
+
91
+ On platforms that support signed zeros, copysign(1.0, -0.0)
92
+ returns -1.0.
93
+ """
94
+ ...
95
+ def cos(x: _SupportsFloatOrIndex, /) -> float:
96
+ """Return the cosine of x (measured in radians)."""
97
+ ...
98
+ def cosh(x: _SupportsFloatOrIndex, /) -> float:
99
+ """Return the hyperbolic cosine of x."""
100
+ ...
101
+ def degrees(x: _SupportsFloatOrIndex, /) -> float:
102
+ """Convert angle x from radians to degrees."""
103
+ ...
104
+ def dist(p: Iterable[_SupportsFloatOrIndex], q: Iterable[_SupportsFloatOrIndex], /) -> float:
105
+ """
106
+ Return the Euclidean distance between two points p and q.
107
+
108
+ The points should be specified as sequences (or iterables) of
109
+ coordinates. Both inputs must have the same dimension.
110
+
111
+ Roughly equivalent to:
112
+ sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))
113
+ """
114
+ ...
115
+ def erf(x: _SupportsFloatOrIndex, /) -> float:
116
+ """Error function at x."""
117
+ ...
118
+ def erfc(x: _SupportsFloatOrIndex, /) -> float:
119
+ """Complementary error function at x."""
120
+ ...
121
+ def exp(x: _SupportsFloatOrIndex, /) -> float:
122
+ """Return e raised to the power of x."""
123
+ ...
44
124
 
45
125
  if sys.version_info >= (3, 11):
46
- def exp2(x: _SupportsFloatOrIndex, /) -> float: ...
126
+ def exp2(x: _SupportsFloatOrIndex, /) -> float:
127
+ """Return 2 raised to the power of x."""
128
+ ...
129
+
130
+ def expm1(x: _SupportsFloatOrIndex, /) -> float:
131
+ """
132
+ Return exp(x)-1.
47
133
 
48
- def expm1(x: _SupportsFloatOrIndex, /) -> float: ...
49
- def fabs(x: _SupportsFloatOrIndex, /) -> float: ...
50
- def factorial(x: SupportsIndex, /) -> int: ...
134
+ This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.
135
+ """
136
+ ...
137
+ def fabs(x: _SupportsFloatOrIndex, /) -> float:
138
+ """Return the absolute value of the float x."""
139
+ ...
140
+ def factorial(x: SupportsIndex, /) -> int:
141
+ """
142
+ Find x!.
143
+
144
+ Raise a ValueError if x is negative or non-integral.
145
+ """
146
+ ...
51
147
 
52
148
  class _SupportsFloor(Protocol[_T_co]):
53
149
  def __floor__(self) -> _T_co: ...
54
150
 
55
151
  @overload
56
- def floor(x: _SupportsFloor[_T], /) -> _T: ...
152
+ def floor(x: _SupportsFloor[_T], /) -> _T:
153
+ """
154
+ Return the floor of x as an Integral.
155
+
156
+ This is the largest integer <= x.
157
+ """
158
+ ...
57
159
  @overload
58
- def floor(x: _SupportsFloatOrIndex, /) -> int: ...
59
- def fmod(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
60
- def frexp(x: _SupportsFloatOrIndex, /) -> tuple[float, int]: ...
61
- def fsum(seq: Iterable[_SupportsFloatOrIndex], /) -> float: ...
62
- def gamma(x: _SupportsFloatOrIndex, /) -> float: ...
160
+ def floor(x: _SupportsFloatOrIndex, /) -> int:
161
+ """
162
+ Return the floor of x as an Integral.
163
+
164
+ This is the largest integer <= x.
165
+ """
166
+ ...
167
+ def fmod(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float:
168
+ """
169
+ Return fmod(x, y), according to platform C.
170
+
171
+ x % y may differ.
172
+ """
173
+ ...
174
+ def frexp(x: _SupportsFloatOrIndex, /) -> tuple[float, int]:
175
+ """
176
+ Return the mantissa and exponent of x, as pair (m, e).
177
+
178
+ m is a float and e is an int, such that x = m * 2.**e.
179
+ If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.
180
+ """
181
+ ...
182
+ def fsum(seq: Iterable[_SupportsFloatOrIndex], /) -> float:
183
+ """
184
+ Return an accurate floating point sum of values in the iterable seq.
185
+
186
+ Assumes IEEE-754 floating point arithmetic.
187
+ """
188
+ ...
189
+ def gamma(x: _SupportsFloatOrIndex, /) -> float:
190
+ """Gamma function at x."""
191
+ ...
63
192
 
64
193
  if sys.version_info >= (3, 9):
65
- def gcd(*integers: SupportsIndex) -> int: ...
194
+ def gcd(*integers: SupportsIndex) -> int:
195
+ """Greatest Common Divisor."""
196
+ ...
66
197
 
67
198
  else:
68
- def gcd(x: SupportsIndex, y: SupportsIndex, /) -> int: ...
199
+ def gcd(x: SupportsIndex, y: SupportsIndex, /) -> int:
200
+ """greatest common divisor of x and y"""
201
+ ...
202
+
203
+ def hypot(*coordinates: _SupportsFloatOrIndex) -> float:
204
+ """
205
+ hypot(*coordinates) -> value
206
+
207
+ Multidimensional Euclidean distance from the origin to a point.
208
+
209
+ Roughly equivalent to:
210
+ sqrt(sum(x**2 for x in coordinates))
211
+
212
+ For a two dimensional point (x, y), gives the hypotenuse
213
+ using the Pythagorean theorem: sqrt(x*x + y*y).
214
+
215
+ For example, the hypotenuse of a 3/4/5 right triangle is:
69
216
 
70
- def hypot(*coordinates: _SupportsFloatOrIndex) -> float: ...
217
+ >>> hypot(3.0, 4.0)
218
+ 5.0
219
+ """
220
+ ...
71
221
  def isclose(
72
222
  a: _SupportsFloatOrIndex,
73
223
  b: _SupportsFloatOrIndex,
74
224
  *,
75
225
  rel_tol: _SupportsFloatOrIndex = 1e-09,
76
226
  abs_tol: _SupportsFloatOrIndex = 0.0,
77
- ) -> bool: ...
78
- def isinf(x: _SupportsFloatOrIndex, /) -> bool: ...
79
- def isfinite(x: _SupportsFloatOrIndex, /) -> bool: ...
80
- def isnan(x: _SupportsFloatOrIndex, /) -> bool: ...
81
- def isqrt(n: SupportsIndex, /) -> int: ...
227
+ ) -> bool:
228
+ """
229
+ Determine whether two floating point numbers are close in value.
230
+
231
+ rel_tol
232
+ maximum difference for being considered "close", relative to the
233
+ magnitude of the input values
234
+ abs_tol
235
+ maximum difference for being considered "close", regardless of the
236
+ magnitude of the input values
237
+
238
+ Return True if a is close in value to b, and False otherwise.
239
+
240
+ For the values to be considered close, the difference between them
241
+ must be smaller than at least one of the tolerances.
242
+
243
+ -inf, inf and NaN behave similarly to the IEEE 754 Standard. That
244
+ is, NaN is not close to anything, even itself. inf and -inf are
245
+ only close to themselves.
246
+ """
247
+ ...
248
+ def isinf(x: _SupportsFloatOrIndex, /) -> bool:
249
+ """Return True if x is a positive or negative infinity, and False otherwise."""
250
+ ...
251
+ def isfinite(x: _SupportsFloatOrIndex, /) -> bool:
252
+ """Return True if x is neither an infinity nor a NaN, and False otherwise."""
253
+ ...
254
+ def isnan(x: _SupportsFloatOrIndex, /) -> bool:
255
+ """Return True if x is a NaN (not a number), and False otherwise."""
256
+ ...
257
+ def isqrt(n: SupportsIndex, /) -> int:
258
+ """Return the integer part of the square root of the input."""
259
+ ...
82
260
 
83
261
  if sys.version_info >= (3, 9):
84
- def lcm(*integers: SupportsIndex) -> int: ...
262
+ def lcm(*integers: SupportsIndex) -> int:
263
+ """Least Common Multiple."""
264
+ ...
265
+
266
+ def ldexp(x: _SupportsFloatOrIndex, i: int, /) -> float:
267
+ """
268
+ Return x * (2**i).
269
+
270
+ This is essentially the inverse of frexp().
271
+ """
272
+ ...
273
+ def lgamma(x: _SupportsFloatOrIndex, /) -> float:
274
+ """Natural logarithm of absolute value of Gamma function at x."""
275
+ ...
276
+ def log(x: _SupportsFloatOrIndex, base: _SupportsFloatOrIndex = ...) -> float:
277
+ """
278
+ log(x, [base=math.e])
279
+ Return the logarithm of x to the given base.
85
280
 
86
- def ldexp(x: _SupportsFloatOrIndex, i: int, /) -> float: ...
87
- def lgamma(x: _SupportsFloatOrIndex, /) -> float: ...
88
- def log(x: _SupportsFloatOrIndex, base: _SupportsFloatOrIndex = ...) -> float: ...
89
- def log10(x: _SupportsFloatOrIndex, /) -> float: ...
90
- def log1p(x: _SupportsFloatOrIndex, /) -> float: ...
91
- def log2(x: _SupportsFloatOrIndex, /) -> float: ...
92
- def modf(x: _SupportsFloatOrIndex, /) -> tuple[float, float]: ...
281
+ If the base not specified, returns the natural logarithm (base e) of x.
282
+ """
283
+ ...
284
+ def log10(x: _SupportsFloatOrIndex, /) -> float:
285
+ """Return the base 10 logarithm of x."""
286
+ ...
287
+ def log1p(x: _SupportsFloatOrIndex, /) -> float:
288
+ """
289
+ Return the natural logarithm of 1+x (base e).
290
+
291
+ The result is computed in a way which is accurate for x near zero.
292
+ """
293
+ ...
294
+ def log2(x: _SupportsFloatOrIndex, /) -> float:
295
+ """Return the base 2 logarithm of x."""
296
+ ...
297
+ def modf(x: _SupportsFloatOrIndex, /) -> tuple[float, float]:
298
+ """
299
+ Return the fractional and integer parts of x.
300
+
301
+ Both results carry the sign of x and are floats.
302
+ """
303
+ ...
93
304
 
94
305
  if sys.version_info >= (3, 12):
95
- def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /, *, steps: SupportsIndex | None = None) -> float: ...
306
+ def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /, *, steps: SupportsIndex | None = None) -> float:
307
+ """
308
+ Return the floating-point value the given number of steps after x towards y.
309
+
310
+ If steps is not specified or is None, it defaults to 1.
311
+
312
+ Raises a TypeError, if x or y is not a double, or if steps is not an integer.
313
+ Raises ValueError if steps is negative.
314
+ """
315
+ ...
96
316
 
97
317
  elif sys.version_info >= (3, 9):
98
- def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
318
+ def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float:
319
+ """Return the next floating-point value after x towards y."""
320
+ ...
321
+
322
+ def perm(n: SupportsIndex, k: SupportsIndex | None = None, /) -> int:
323
+ """
324
+ Number of ways to choose k items from n items without repetition and with order.
99
325
 
100
- def perm(n: SupportsIndex, k: SupportsIndex | None = None, /) -> int: ...
101
- def pow(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
326
+ Evaluates to n! / (n - k)! when k <= n and evaluates
327
+ to zero when k > n.
328
+
329
+ If k is not specified or is None, then k defaults to n
330
+ and the function returns n!.
331
+
332
+ Raises TypeError if either of the arguments are not integers.
333
+ Raises ValueError if either of the arguments are negative.
334
+ """
335
+ ...
336
+ def pow(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float:
337
+ """Return x**y (x to the power of y)."""
338
+ ...
102
339
  @overload
103
- def prod(iterable: Iterable[SupportsIndex], /, *, start: SupportsIndex = 1) -> int: ... # type: ignore[overload-overlap]
340
+ def prod(iterable: Iterable[SupportsIndex], /, *, start: SupportsIndex = 1) -> int:
341
+ """
342
+ Calculate the product of all the elements in the input iterable.
343
+
344
+ The default start value for the product is 1.
345
+
346
+ When the iterable is empty, return the start value. This function is
347
+ intended specifically for use with numeric values and may reject
348
+ non-numeric types.
349
+ """
350
+ ...
104
351
  @overload
105
- def prod(iterable: Iterable[_SupportsFloatOrIndex], /, *, start: _SupportsFloatOrIndex = 1) -> float: ...
106
- def radians(x: _SupportsFloatOrIndex, /) -> float: ...
107
- def remainder(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ...
108
- def sin(x: _SupportsFloatOrIndex, /) -> float: ...
109
- def sinh(x: _SupportsFloatOrIndex, /) -> float: ...
352
+ def prod(iterable: Iterable[_SupportsFloatOrIndex], /, *, start: _SupportsFloatOrIndex = 1) -> float:
353
+ """
354
+ Calculate the product of all the elements in the input iterable.
355
+
356
+ The default start value for the product is 1.
357
+
358
+ When the iterable is empty, return the start value. This function is
359
+ intended specifically for use with numeric values and may reject
360
+ non-numeric types.
361
+ """
362
+ ...
363
+ def radians(x: _SupportsFloatOrIndex, /) -> float:
364
+ """Convert angle x from degrees to radians."""
365
+ ...
366
+ def remainder(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float:
367
+ """
368
+ Difference between x and the closest integer multiple of y.
369
+
370
+ Return x - n*y where n*y is the closest integer multiple of y.
371
+ In the case where x is exactly halfway between two multiples of
372
+ y, the nearest even value of n is used. The result is always exact.
373
+ """
374
+ ...
375
+ def sin(x: _SupportsFloatOrIndex, /) -> float:
376
+ """Return the sine of x (measured in radians)."""
377
+ ...
378
+ def sinh(x: _SupportsFloatOrIndex, /) -> float:
379
+ """Return the hyperbolic sine of x."""
380
+ ...
110
381
 
111
382
  if sys.version_info >= (3, 12):
112
- def sumprod(p: Iterable[float], q: Iterable[float], /) -> float: ...
383
+ def sumprod(p: Iterable[float], q: Iterable[float], /) -> float:
384
+ """
385
+ Return the sum of products of values from two iterables p and q.
386
+
387
+ Roughly equivalent to:
388
+
389
+ sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))
113
390
 
114
- def sqrt(x: _SupportsFloatOrIndex, /) -> float: ...
115
- def tan(x: _SupportsFloatOrIndex, /) -> float: ...
116
- def tanh(x: _SupportsFloatOrIndex, /) -> float: ...
391
+ For float and mixed int/float inputs, the intermediate products
392
+ and sums are computed with extended precision.
393
+ """
394
+ ...
395
+
396
+ def sqrt(x: _SupportsFloatOrIndex, /) -> float:
397
+ """Return the square root of x."""
398
+ ...
399
+ def tan(x: _SupportsFloatOrIndex, /) -> float:
400
+ """Return the tangent of x (measured in radians)."""
401
+ ...
402
+ def tanh(x: _SupportsFloatOrIndex, /) -> float:
403
+ """Return the hyperbolic tangent of x."""
404
+ ...
117
405
 
118
406
  # Is different from `_typeshed.SupportsTrunc`, which is not generic
119
407
  class _SupportsTrunc(Protocol[_T_co]):
120
408
  def __trunc__(self) -> _T_co: ...
121
409
 
122
- def trunc(x: _SupportsTrunc[_T], /) -> _T: ...
410
+ def trunc(x: _SupportsTrunc[_T], /) -> _T:
411
+ """
412
+ Truncates the Real x to the nearest Integral toward 0.
413
+
414
+ Uses the __trunc__ magic method.
415
+ """
416
+ ...
123
417
 
124
418
  if sys.version_info >= (3, 9):
125
- def ulp(x: _SupportsFloatOrIndex, /) -> float: ...
419
+ def ulp(x: _SupportsFloatOrIndex, /) -> float:
420
+ """Return the value of the least significant bit of the float x."""
421
+ ...
126
422
 
127
423
  if sys.version_info >= (3, 13):
128
424
  def fma(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, z: _SupportsFloatOrIndex, /) -> float: ...
@@ -31,6 +31,29 @@ if sys.platform != "win32":
31
31
  PAGESIZE: int
32
32
 
33
33
  class mmap(Iterable[int], Sized):
34
+ """
35
+ Windows: mmap(fileno, length[, tagname[, access[, offset]]])
36
+
37
+ Maps length bytes from the file specified by the file handle fileno,
38
+ and returns a mmap object. If length is larger than the current size
39
+ of the file, the file is extended to contain length bytes. If length
40
+ is 0, the maximum length of the map is the current size of the file,
41
+ except that if the file is empty Windows raises an exception (you cannot
42
+ create an empty mapping on Windows).
43
+
44
+ Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
45
+
46
+ Maps length bytes from the file specified by the file descriptor fileno,
47
+ and returns a mmap object. If length is 0, the maximum length of the map
48
+ will be the current size of the file when mmap is called.
49
+ flags specifies the nature of the mapping. MAP_PRIVATE creates a
50
+ private copy-on-write mapping, so changes to the contents of the mmap
51
+ object will be private to this process, and MAP_SHARED creates a mapping
52
+ that's shared with all other processes mapping the same areas of the file.
53
+ The default value is MAP_SHARED.
54
+
55
+ To map anonymous memory, pass -1 as the fileno (both versions).
56
+ """
34
57
  if sys.platform == "win32":
35
58
  def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ...
36
59
  else:
@@ -48,7 +71,9 @@ class mmap(Iterable[int], Sized):
48
71
  def size(self) -> int: ...
49
72
  def tell(self) -> int: ...
50
73
  def write_byte(self, byte: int) -> None: ...
51
- def __len__(self) -> int: ...
74
+ def __len__(self) -> int:
75
+ """Return len(self)."""
76
+ ...
52
77
  closed: bool
53
78
  if sys.platform != "win32":
54
79
  def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ...
@@ -58,14 +83,24 @@ class mmap(Iterable[int], Sized):
58
83
  def read(self, n: int | None = ...) -> bytes: ...
59
84
  def write(self, bytes: ReadableBuffer) -> int: ...
60
85
  @overload
61
- def __getitem__(self, key: int, /) -> int: ...
86
+ def __getitem__(self, key: int, /) -> int:
87
+ """Return self[key]."""
88
+ ...
62
89
  @overload
63
- def __getitem__(self, key: slice, /) -> bytes: ...
64
- def __delitem__(self, key: int | slice, /) -> NoReturn: ...
90
+ def __getitem__(self, key: slice, /) -> bytes:
91
+ """Return self[key]."""
92
+ ...
93
+ def __delitem__(self, key: int | slice, /) -> NoReturn:
94
+ """Delete self[key]."""
95
+ ...
65
96
  @overload
66
- def __setitem__(self, key: int, value: int, /) -> None: ...
97
+ def __setitem__(self, key: int, value: int, /) -> None:
98
+ """Set self[key] to value."""
99
+ ...
67
100
  @overload
68
- def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None: ...
101
+ def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None:
102
+ """Set self[key] to value."""
103
+ ...
69
104
  # Doesn't actually exist, but the object actually supports "in" because it has __getitem__,
70
105
  # so we claim that there is also a __contains__ to help type checkers.
71
106
  def __contains__(self, o: object, /) -> bool: ...
@@ -74,8 +109,12 @@ class mmap(Iterable[int], Sized):
74
109
  def __iter__(self) -> Iterator[int]: ...
75
110
  def __enter__(self) -> Self: ...
76
111
  def __exit__(self, *args: Unused) -> None: ...
77
- def __buffer__(self, flags: int, /) -> memoryview: ...
78
- def __release_buffer__(self, buffer: memoryview, /) -> None: ...
112
+ def __buffer__(self, flags: int, /) -> memoryview:
113
+ """Return a buffer object that exposes the underlying memory of the object."""
114
+ ...
115
+ def __release_buffer__(self, buffer: memoryview, /) -> None:
116
+ """Release the buffer object that exposes the underlying memory of the object."""
117
+ ...
79
118
  if sys.version_info >= (3, 13):
80
119
  def seekable(self) -> bool: ...
81
120
 
@@ -1,32 +1,32 @@
1
- import sys
2
- from typing import Final, Literal
3
-
4
- # This module is only available on Windows
5
- if sys.platform == "win32":
6
- CRT_ASSEMBLY_VERSION: Final[str]
7
- LK_UNLCK: Literal[0]
8
- LK_LOCK: Literal[1]
9
- LK_NBLCK: Literal[2]
10
- LK_RLCK: Literal[3]
11
- LK_NBRLCK: Literal[4]
12
- SEM_FAILCRITICALERRORS: int
13
- SEM_NOALIGNMENTFAULTEXCEPT: int
14
- SEM_NOGPFAULTERRORBOX: int
15
- SEM_NOOPENFILEERRORBOX: int
16
- def locking(fd: int, mode: int, nbytes: int, /) -> None: ...
17
- def setmode(fd: int, mode: int, /) -> int: ...
18
- def open_osfhandle(handle: int, flags: int, /) -> int: ...
19
- def get_osfhandle(fd: int, /) -> int: ...
20
- def kbhit() -> bool: ...
21
- def getch() -> bytes: ...
22
- def getwch() -> str: ...
23
- def getche() -> bytes: ...
24
- def getwche() -> str: ...
25
- def putch(char: bytes | bytearray, /) -> None: ...
26
- def putwch(unicode_char: str, /) -> None: ...
27
- def ungetch(char: bytes | bytearray, /) -> None: ...
28
- def ungetwch(unicode_char: str, /) -> None: ...
29
- def heapmin() -> None: ...
30
- def SetErrorMode(mode: int, /) -> int: ...
31
- if sys.version_info >= (3, 10):
32
- def GetErrorMode() -> int: ... # undocumented
1
+ import sys
2
+ from typing import Final, Literal
3
+
4
+ # This module is only available on Windows
5
+ if sys.platform == "win32":
6
+ CRT_ASSEMBLY_VERSION: Final[str]
7
+ LK_UNLCK: Literal[0]
8
+ LK_LOCK: Literal[1]
9
+ LK_NBLCK: Literal[2]
10
+ LK_RLCK: Literal[3]
11
+ LK_NBRLCK: Literal[4]
12
+ SEM_FAILCRITICALERRORS: int
13
+ SEM_NOALIGNMENTFAULTEXCEPT: int
14
+ SEM_NOGPFAULTERRORBOX: int
15
+ SEM_NOOPENFILEERRORBOX: int
16
+ def locking(fd: int, mode: int, nbytes: int, /) -> None: ...
17
+ def setmode(fd: int, mode: int, /) -> int: ...
18
+ def open_osfhandle(handle: int, flags: int, /) -> int: ...
19
+ def get_osfhandle(fd: int, /) -> int: ...
20
+ def kbhit() -> bool: ...
21
+ def getch() -> bytes: ...
22
+ def getwch() -> str: ...
23
+ def getche() -> bytes: ...
24
+ def getwche() -> str: ...
25
+ def putch(char: bytes | bytearray, /) -> None: ...
26
+ def putwch(unicode_char: str, /) -> None: ...
27
+ def ungetch(char: bytes | bytearray, /) -> None: ...
28
+ def ungetwch(unicode_char: str, /) -> None: ...
29
+ def heapmin() -> None: ...
30
+ def SetErrorMode(mode: int, /) -> int: ...
31
+ if sys.version_info >= (3, 10):
32
+ def GetErrorMode() -> int: ... # undocumented