basedpyright 1.31.6 → 1.31.7

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/pyright-langserver.js +1 -1
  3. package/dist/pyright-langserver.js.map +1 -1
  4. package/dist/pyright.js +1 -1
  5. package/dist/pyright.js.map +1 -1
  6. package/dist/typeshed-fallback/stdlib/_asyncio.pyi +6 -2
  7. package/dist/typeshed-fallback/stdlib/_compression.pyi +28 -28
  8. package/dist/typeshed-fallback/stdlib/_contextvars.pyi +6 -2
  9. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +10 -51
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +187 -17
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +7 -1
  12. package/dist/typeshed-fallback/stdlib/_heapq.pyi +20 -5
  13. package/dist/typeshed-fallback/stdlib/_interpqueues.pyi +6 -6
  14. package/dist/typeshed-fallback/stdlib/_interpreters.pyi +1 -7
  15. package/dist/typeshed-fallback/stdlib/_io.pyi +9 -5
  16. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +12 -20
  17. package/dist/typeshed-fallback/stdlib/_operator.pyi +6 -2
  18. package/dist/typeshed-fallback/stdlib/_pickle.pyi +3 -3
  19. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +26 -26
  20. package/dist/typeshed-fallback/stdlib/_socket.pyi +6 -18
  21. package/dist/typeshed-fallback/stdlib/_stat.pyi +1 -1
  22. package/dist/typeshed-fallback/stdlib/_thread.pyi +10 -2
  23. package/dist/typeshed-fallback/stdlib/_zstd.pyi +300 -97
  24. package/dist/typeshed-fallback/stdlib/annotationlib.pyi +146 -146
  25. package/dist/typeshed-fallback/stdlib/ast.pyi +256 -96
  26. package/dist/typeshed-fallback/stdlib/asyncio/graph.pyi +28 -28
  27. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +3 -1
  28. package/dist/typeshed-fallback/stdlib/asyncio/tools.pyi +46 -46
  29. package/dist/typeshed-fallback/stdlib/builtins.pyi +46 -36
  30. package/dist/typeshed-fallback/stdlib/compression/_common/_streams.pyi +26 -26
  31. package/dist/typeshed-fallback/stdlib/compression/bz2.pyi +1 -1
  32. package/dist/typeshed-fallback/stdlib/compression/gzip.pyi +1 -1
  33. package/dist/typeshed-fallback/stdlib/compression/lzma.pyi +1 -1
  34. package/dist/typeshed-fallback/stdlib/compression/zlib.pyi +1 -1
  35. package/dist/typeshed-fallback/stdlib/compression/zstd/__init__.pyi +88 -88
  36. package/dist/typeshed-fallback/stdlib/compression/zstd/_zstdfile.pyi +117 -117
  37. package/dist/typeshed-fallback/stdlib/concurrent/futures/interpreter.pyi +79 -79
  38. package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +8 -8
  39. package/dist/typeshed-fallback/stdlib/concurrent/interpreters/__init__.pyi +68 -68
  40. package/dist/typeshed-fallback/stdlib/concurrent/interpreters/_crossinterp.pyi +30 -30
  41. package/dist/typeshed-fallback/stdlib/concurrent/interpreters/_queues.pyi +74 -74
  42. package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +7 -1
  43. package/dist/typeshed-fallback/stdlib/datetime.pyi +6 -2
  44. package/dist/typeshed-fallback/stdlib/decimal.pyi +12 -1
  45. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +7 -5
  46. package/dist/typeshed-fallback/stdlib/functools.pyi +5 -9
  47. package/dist/typeshed-fallback/stdlib/gc.pyi +1 -1
  48. package/dist/typeshed-fallback/stdlib/marshal.pyi +6 -6
  49. package/dist/typeshed-fallback/stdlib/math.pyi +1 -3
  50. package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +3 -1
  51. package/dist/typeshed-fallback/stdlib/numbers.pyi +2 -10
  52. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +15 -1
  53. package/dist/typeshed-fallback/stdlib/pathlib/__init__.pyi +6 -1
  54. package/dist/typeshed-fallback/stdlib/pathlib/types.pyi +8 -8
  55. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +1 -1
  56. package/dist/typeshed-fallback/stdlib/string/templatelib.pyi +46 -36
  57. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +25 -2
  58. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +7 -1
  59. package/dist/typeshed-fallback/stdlib/types.pyi +22 -8
  60. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +2 -2
  61. package/dist/typeshed-fallback/stdlib/winsound.pyi +4 -0
  62. package/dist/typeshed-fallback/stdlib/xxlimited.pyi +3 -16
  63. package/package.json +1 -1
@@ -308,5 +308,9 @@ if sys.version_info >= (3, 12):
308
308
 
309
309
  if sys.version_info >= (3, 14):
310
310
  def future_discard_from_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
311
- def future_add_to_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
312
- def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
311
+ def future_add_to_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None:
312
+ """Record that `fut` is awaited on by `waiter`."""
313
+ ...
314
+ def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]:
315
+ """Return a set of all tasks for the loop."""
316
+ ...
@@ -1,28 +1,28 @@
1
- # _compression is replaced by compression._common._streams on Python 3.14+ (PEP-784)
2
-
3
- from _typeshed import Incomplete, WriteableBuffer
4
- from collections.abc import Callable
5
- from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase
6
- from typing import Any, Protocol, type_check_only
7
-
8
- BUFFER_SIZE = DEFAULT_BUFFER_SIZE
9
-
10
- @type_check_only
11
- class _Reader(Protocol):
12
- def read(self, n: int, /) -> bytes: ...
13
- def seekable(self) -> bool: ...
14
- def seek(self, n: int, /) -> Any: ...
15
-
16
- class BaseStream(BufferedIOBase): ...
17
-
18
- class DecompressReader(RawIOBase):
19
- def __init__(
20
- self,
21
- fp: _Reader,
22
- decomp_factory: Callable[..., Incomplete],
23
- trailing_error: type[Exception] | tuple[type[Exception], ...] = (),
24
- **decomp_args: Any, # These are passed to decomp_factory.
25
- ) -> None: ...
26
- def readinto(self, b: WriteableBuffer) -> int: ...
27
- def read(self, size: int = -1) -> bytes: ...
28
- def seek(self, offset: int, whence: int = 0) -> int: ...
1
+ # _compression is replaced by compression._common._streams on Python 3.14+ (PEP-784)
2
+
3
+ from _typeshed import Incomplete, WriteableBuffer
4
+ from collections.abc import Callable
5
+ from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase
6
+ from typing import Any, Protocol, type_check_only
7
+
8
+ BUFFER_SIZE = DEFAULT_BUFFER_SIZE
9
+
10
+ @type_check_only
11
+ class _Reader(Protocol):
12
+ def read(self, n: int, /) -> bytes: ...
13
+ def seekable(self) -> bool: ...
14
+ def seek(self, n: int, /) -> Any: ...
15
+
16
+ class BaseStream(BufferedIOBase): ...
17
+
18
+ class DecompressReader(RawIOBase):
19
+ def __init__(
20
+ self,
21
+ fp: _Reader,
22
+ decomp_factory: Callable[..., Incomplete],
23
+ trailing_error: type[Exception] | tuple[type[Exception], ...] = (),
24
+ **decomp_args: Any, # These are passed to decomp_factory.
25
+ ) -> None: ...
26
+ def readinto(self, b: WriteableBuffer) -> int: ...
27
+ def read(self, size: int = -1) -> bytes: ...
28
+ def seek(self, offset: int, whence: int = 0) -> int: ...
@@ -91,10 +91,14 @@ class Token(Generic[_T]):
91
91
  """See PEP 585"""
92
92
  ...
93
93
  if sys.version_info >= (3, 14):
94
- def __enter__(self) -> Self: ...
94
+ def __enter__(self) -> Self:
95
+ """Enter into Token context manager."""
96
+ ...
95
97
  def __exit__(
96
98
  self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
97
- ) -> None: ...
99
+ ) -> None:
100
+ """Exit from Token context manager, restore the linked ContextVar."""
101
+ ...
98
102
 
99
103
  def copy_context() -> Context: ...
100
104
 
@@ -154,38 +154,10 @@ class _Pointer(_PointerLike, _CData, Generic[_CT], metaclass=_PyCPointerType):
154
154
 
155
155
  if sys.version_info < (3, 14):
156
156
  @overload
157
- def POINTER(type: None, /) -> type[c_void_p]:
158
- """
159
- Create and return a new ctypes pointer type.
160
-
161
- type
162
- A ctypes type.
163
-
164
- Pointer types are cached and reused internally,
165
- so calling this function repeatedly is cheap.
166
- """
167
- ...
157
+ def POINTER(type: None, /) -> type[c_void_p]: ...
168
158
  @overload
169
- def POINTER(type: type[_CT], /) -> type[_Pointer[_CT]]:
170
- """
171
- Create and return a new ctypes pointer type.
172
-
173
- type
174
- A ctypes type.
175
-
176
- Pointer types are cached and reused internally,
177
- so calling this function repeatedly is cheap.
178
- """
179
- ...
180
- def pointer(obj: _CT, /) -> _Pointer[_CT]:
181
- """
182
- Create a new pointer instance, pointing to 'obj'.
183
-
184
- The returned object is of the type POINTER(type(obj)). Note that if you
185
- just want to pass a pointer to an object to a foreign function call, you
186
- should use byref(obj) which is much faster.
187
- """
188
- ...
159
+ def POINTER(type: type[_CT], /) -> type[_Pointer[_CT]]: ...
160
+ def pointer(obj: _CT, /) -> _Pointer[_CT]: ...
189
161
 
190
162
  # This class is not exposed. It calls itself _ctypes.CArgObject.
191
163
  @final
@@ -193,16 +165,12 @@ if sys.version_info < (3, 14):
193
165
  class _CArgObject: ...
194
166
 
195
167
  if sys.version_info >= (3, 14):
196
- def byref(obj: _CData | _CDataType, offset: int = 0, /) -> _CArgObject: ...
168
+ def byref(obj: _CData | _CDataType, offset: int = 0, /) -> _CArgObject:
169
+ """Return a pointer lookalike to a C instance, only usable as function argument."""
170
+ ...
197
171
 
198
172
  else:
199
- def byref(obj: _CData | _CDataType, offset: int = 0) -> _CArgObject:
200
- """
201
- byref(C instance[, offset=0]) -> byref-object
202
- Return a pointer lookalike to a C instance, only usable
203
- as function argument
204
- """
205
- ...
173
+ def byref(obj: _CData | _CDataType, offset: int = 0) -> _CArgObject: ...
206
174
 
207
175
  _ECT: TypeAlias = Callable[[_CData | _CDataType | None, CFuncPtr, tuple[_CData | _CDataType, ...]], _CDataType]
208
176
  _PF: TypeAlias = tuple[int] | tuple[int, str | None] | tuple[int, str | None, Any]
@@ -408,10 +376,7 @@ class Array(_CData, Generic[_CT], metaclass=_PyCArrayType):
408
376
  ...
409
377
 
410
378
  def addressof(obj: _CData | _CDataType, /) -> int:
411
- """
412
- addressof(C instance) -> integer
413
- Return the address of the C instance internal buffer
414
- """
379
+ """Return the address of the C instance internal buffer"""
415
380
  ...
416
381
  def alignment(obj_or_type: _CData | _CDataType | type[_CData | _CDataType], /) -> int:
417
382
  """
@@ -421,16 +386,10 @@ def alignment(obj_or_type: _CData | _CDataType | type[_CData | _CDataType], /) -
421
386
  """
422
387
  ...
423
388
  def get_errno() -> int: ...
424
- def resize(obj: _CData | _CDataType, size: int, /) -> None:
425
- """Resize the memory buffer of a ctypes instance"""
426
- ...
389
+ def resize(obj: _CData | _CDataType, size: int, /) -> None: ...
427
390
  def set_errno(value: int, /) -> int: ...
428
391
  def sizeof(obj_or_type: _CData | _CDataType | type[_CData | _CDataType], /) -> int:
429
- """
430
- sizeof(C type) -> integer
431
- sizeof(C instance) -> integer
432
- Return the size in bytes of a C instance
433
- """
392
+ """Return the size in bytes of a C instance."""
434
393
  ...
435
394
  def PyObj_FromPtr(address: int, /) -> Any: ...
436
395
  def Py_DECREF(o: _T, /) -> _T: ...
@@ -460,7 +460,16 @@ if sys.version_info >= (3, 10):
460
460
  ...
461
461
 
462
462
  if sys.version_info >= (3, 14):
463
- def assume_default_colors(fg: int, bg: int, /) -> None: ...
463
+ def assume_default_colors(fg: int, bg: int, /) -> None:
464
+ """
465
+ Allow use of default values for colors on terminals supporting this feature.
466
+
467
+ Assign terminal default foreground/background colors to color number -1.
468
+ Change the definition of the color-pair 0 to (fg, bg).
469
+
470
+ Use this to support transparency in your application.
471
+ """
472
+ ...
464
473
 
465
474
  def has_ic() -> bool:
466
475
  """Return True if the terminal has insert- and delete-character capabilities."""
@@ -900,12 +909,7 @@ def ungetmouse(id: int, x: int, y: int, z: int, bstate: int, /) -> None:
900
909
  ...
901
910
  def update_lines_cols() -> None: ...
902
911
  def use_default_colors() -> None:
903
- """
904
- Allow use of default values for colors on terminals supporting this feature.
905
-
906
- Use this to support transparency in your application. The default color
907
- is assigned to the color number -1.
908
- """
912
+ """Equivalent to assume_default_colors(-1, -1)."""
909
913
  ...
910
914
  def use_env(flag: bool, /) -> None:
911
915
  """
@@ -1154,13 +1158,97 @@ class window: # undocumented
1154
1158
  """
1155
1159
  ...
1156
1160
  @overload
1157
- def chgat(self, attr: int) -> None: ...
1161
+ def chgat(self, attr: int) -> None:
1162
+ """
1163
+ chgat([y, x,] [n=-1,] attr)
1164
+ Set the attributes of characters.
1165
+
1166
+ y
1167
+ Y-coordinate.
1168
+ x
1169
+ X-coordinate.
1170
+ n
1171
+ Number of characters.
1172
+ attr
1173
+ Attributes for characters.
1174
+
1175
+ Set the attributes of num characters at the current cursor position, or at
1176
+ position (y, x) if supplied. If no value of num is given or num = -1, the
1177
+ attribute will be set on all the characters to the end of the line. This
1178
+ function does not move the cursor. The changed line will be touched using
1179
+ the touchline() method so that the contents will be redisplayed by the next
1180
+ window refresh.
1181
+ """
1182
+ ...
1158
1183
  @overload
1159
- def chgat(self, num: int, attr: int) -> None: ...
1184
+ def chgat(self, num: int, attr: int) -> None:
1185
+ """
1186
+ chgat([y, x,] [n=-1,] attr)
1187
+ Set the attributes of characters.
1188
+
1189
+ y
1190
+ Y-coordinate.
1191
+ x
1192
+ X-coordinate.
1193
+ n
1194
+ Number of characters.
1195
+ attr
1196
+ Attributes for characters.
1197
+
1198
+ Set the attributes of num characters at the current cursor position, or at
1199
+ position (y, x) if supplied. If no value of num is given or num = -1, the
1200
+ attribute will be set on all the characters to the end of the line. This
1201
+ function does not move the cursor. The changed line will be touched using
1202
+ the touchline() method so that the contents will be redisplayed by the next
1203
+ window refresh.
1204
+ """
1205
+ ...
1160
1206
  @overload
1161
- def chgat(self, y: int, x: int, attr: int) -> None: ...
1207
+ def chgat(self, y: int, x: int, attr: int) -> None:
1208
+ """
1209
+ chgat([y, x,] [n=-1,] attr)
1210
+ Set the attributes of characters.
1211
+
1212
+ y
1213
+ Y-coordinate.
1214
+ x
1215
+ X-coordinate.
1216
+ n
1217
+ Number of characters.
1218
+ attr
1219
+ Attributes for characters.
1220
+
1221
+ Set the attributes of num characters at the current cursor position, or at
1222
+ position (y, x) if supplied. If no value of num is given or num = -1, the
1223
+ attribute will be set on all the characters to the end of the line. This
1224
+ function does not move the cursor. The changed line will be touched using
1225
+ the touchline() method so that the contents will be redisplayed by the next
1226
+ window refresh.
1227
+ """
1228
+ ...
1162
1229
  @overload
1163
- def chgat(self, y: int, x: int, num: int, attr: int) -> None: ...
1230
+ def chgat(self, y: int, x: int, num: int, attr: int) -> None:
1231
+ """
1232
+ chgat([y, x,] [n=-1,] attr)
1233
+ Set the attributes of characters.
1234
+
1235
+ y
1236
+ Y-coordinate.
1237
+ x
1238
+ X-coordinate.
1239
+ n
1240
+ Number of characters.
1241
+ attr
1242
+ Attributes for characters.
1243
+
1244
+ Set the attributes of num characters at the current cursor position, or at
1245
+ position (y, x) if supplied. If no value of num is given or num = -1, the
1246
+ attribute will be set on all the characters to the end of the line. This
1247
+ function does not move the cursor. The changed line will be touched using
1248
+ the touchline() method so that the contents will be redisplayed by the next
1249
+ window refresh.
1250
+ """
1251
+ ...
1164
1252
  def clear(self) -> None: ...
1165
1253
  def clearok(self, yes: int) -> None: ...
1166
1254
  def clrtobot(self) -> None: ...
@@ -1353,13 +1441,61 @@ class window: # undocumented
1353
1441
  def getmaxyx(self) -> tuple[int, int]: ...
1354
1442
  def getparyx(self) -> tuple[int, int]: ...
1355
1443
  @overload
1356
- def getstr(self) -> bytes: ...
1444
+ def getstr(self) -> bytes:
1445
+ """
1446
+ getstr([[y, x,] n=2047])
1447
+ Read a string from the user, with primitive line editing capacity.
1448
+
1449
+ y
1450
+ Y-coordinate.
1451
+ x
1452
+ X-coordinate.
1453
+ n
1454
+ Maximal number of characters.
1455
+ """
1456
+ ...
1357
1457
  @overload
1358
- def getstr(self, n: int) -> bytes: ...
1458
+ def getstr(self, n: int) -> bytes:
1459
+ """
1460
+ getstr([[y, x,] n=2047])
1461
+ Read a string from the user, with primitive line editing capacity.
1462
+
1463
+ y
1464
+ Y-coordinate.
1465
+ x
1466
+ X-coordinate.
1467
+ n
1468
+ Maximal number of characters.
1469
+ """
1470
+ ...
1359
1471
  @overload
1360
- def getstr(self, y: int, x: int) -> bytes: ...
1472
+ def getstr(self, y: int, x: int) -> bytes:
1473
+ """
1474
+ getstr([[y, x,] n=2047])
1475
+ Read a string from the user, with primitive line editing capacity.
1476
+
1477
+ y
1478
+ Y-coordinate.
1479
+ x
1480
+ X-coordinate.
1481
+ n
1482
+ Maximal number of characters.
1483
+ """
1484
+ ...
1361
1485
  @overload
1362
- def getstr(self, y: int, x: int, n: int) -> bytes: ...
1486
+ def getstr(self, y: int, x: int, n: int) -> bytes:
1487
+ """
1488
+ getstr([[y, x,] n=2047])
1489
+ Read a string from the user, with primitive line editing capacity.
1490
+
1491
+ y
1492
+ Y-coordinate.
1493
+ x
1494
+ X-coordinate.
1495
+ n
1496
+ Maximal number of characters.
1497
+ """
1498
+ ...
1363
1499
  def getyx(self) -> tuple[int, int]: ...
1364
1500
  @overload
1365
1501
  def hline(self, ch: _ChType, n: int) -> None:
@@ -1563,9 +1699,43 @@ class window: # undocumented
1563
1699
  """
1564
1700
  ...
1565
1701
  @overload
1566
- def instr(self, n: int = 2047) -> bytes: ...
1702
+ def instr(self, n: int = 2047) -> bytes:
1703
+ """
1704
+ instr([y, x,] n=2047)
1705
+ Return a string of characters, extracted from the window.
1706
+
1707
+ y
1708
+ Y-coordinate.
1709
+ x
1710
+ X-coordinate.
1711
+ n
1712
+ Maximal number of characters.
1713
+
1714
+ Return a string of characters, extracted from the window starting at the
1715
+ current cursor position, or at y, x if specified. Attributes are stripped
1716
+ from the characters. If n is specified, instr() returns a string at most
1717
+ n characters long (exclusive of the trailing NUL).
1718
+ """
1719
+ ...
1567
1720
  @overload
1568
- def instr(self, y: int, x: int, n: int = 2047) -> bytes: ...
1721
+ def instr(self, y: int, x: int, n: int = 2047) -> bytes:
1722
+ """
1723
+ instr([y, x,] n=2047)
1724
+ Return a string of characters, extracted from the window.
1725
+
1726
+ y
1727
+ Y-coordinate.
1728
+ x
1729
+ X-coordinate.
1730
+ n
1731
+ Maximal number of characters.
1732
+
1733
+ Return a string of characters, extracted from the window starting at the
1734
+ current cursor position, or at y, x if specified. Attributes are stripped
1735
+ from the characters. If n is specified, instr() returns a string at most
1736
+ n characters long (exclusive of the trailing NUL).
1737
+ """
1738
+ ...
1569
1739
  def is_linetouched(self, line: int, /) -> bool:
1570
1740
  """
1571
1741
  Return True if the specified line was modified, otherwise return False.
@@ -78,7 +78,13 @@ else:
78
78
  def localcontext(ctx: Context | None = None) -> _ContextManager: ...
79
79
 
80
80
  if sys.version_info >= (3, 14):
81
- def IEEEContext(bits: int, /) -> Context: ...
81
+ def IEEEContext(bits: int, /) -> Context:
82
+ """
83
+ Return a context object initialized to the proper values for one of the
84
+ IEEE interchange formats. The argument must be a multiple of 32 and less
85
+ than IEEE_CONTEXT_MAX_BITS.
86
+ """
87
+ ...
82
88
 
83
89
  DefaultContext: Context
84
90
  BasicContext: Context
@@ -67,8 +67,23 @@ def heapreplace(heap: list[_T], item: _T, /) -> _T:
67
67
  ...
68
68
 
69
69
  if sys.version_info >= (3, 14):
70
- def heapify_max(heap: list[_T], /) -> None: ...
71
- def heappop_max(heap: list[_T], /) -> _T: ...
72
- def heappush_max(heap: list[_T], item: _T, /) -> None: ...
73
- def heappushpop_max(heap: list[_T], item: _T, /) -> _T: ...
74
- def heapreplace_max(heap: list[_T], item: _T, /) -> _T: ...
70
+ def heapify_max(heap: list[_T], /) -> None:
71
+ """Maxheap variant of heapify."""
72
+ ...
73
+ def heappop_max(heap: list[_T], /) -> _T:
74
+ """Maxheap variant of heappop."""
75
+ ...
76
+ def heappush_max(heap: list[_T], item: _T, /) -> None:
77
+ """Push item onto max heap, maintaining the heap invariant."""
78
+ ...
79
+ def heappushpop_max(heap: list[_T], item: _T, /) -> _T:
80
+ """
81
+ Maxheap variant of heappushpop.
82
+
83
+ The combined action runs more efficiently than heappush_max() followed by
84
+ a separate call to heappop_max().
85
+ """
86
+ ...
87
+ def heapreplace_max(heap: list[_T], item: _T, /) -> _T:
88
+ """Maxheap variant of heapreplace."""
89
+ ...
@@ -23,7 +23,7 @@ def bind(qid: SupportsIndex) -> None:
23
23
  ...
24
24
  def create(maxsize: SupportsIndex, fmt: SupportsIndex, unboundop: _UnboundOp) -> int:
25
25
  """
26
- create(maxsize, fmt, unboundop) -> qid
26
+ create(maxsize, unboundop, fallback) -> qid
27
27
 
28
28
  Create a new cross-interpreter queue and return its unique generated ID.
29
29
  It is a new reference as though bind() had been called on the queue.
@@ -42,10 +42,10 @@ def destroy(qid: SupportsIndex) -> None:
42
42
  ...
43
43
  def get(qid: SupportsIndex) -> tuple[Any, int, _UnboundOp | None]:
44
44
  """
45
- get(qid) -> (obj, fmt)
45
+ get(qid) -> (obj, unboundop)
46
46
 
47
47
  Return a new object from the data at the front of the queue.
48
- The object's format is also returned.
48
+ The unbound op is also returned.
49
49
 
50
50
  If there is nothing to receive then raise QueueEmpty.
51
51
  """
@@ -80,15 +80,15 @@ def is_full(qid: SupportsIndex) -> bool:
80
80
  ...
81
81
  def list_all() -> list[tuple[int, int, _UnboundOp]]:
82
82
  """
83
- list_all() -> [(qid, fmt)]
83
+ list_all() -> [(qid, unboundop, fallback)]
84
84
 
85
85
  Return the list of IDs for all queues.
86
- Each corresponding default format is also included.
86
+ Each corresponding default unbound op and fallback is also included.
87
87
  """
88
88
  ...
89
89
  def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex, unboundop: _UnboundOp) -> None:
90
90
  """
91
- put(qid, obj, fmt)
91
+ put(qid, obj)
92
92
 
93
93
  Add the object's data to the queue.
94
94
  """
@@ -49,7 +49,7 @@ def create(config: types.SimpleNamespace | _Configs | None = "isolated", *, reqr
49
49
  The caller is responsible for destroying the interpreter before exiting,
50
50
  typically by using _interpreters.destroy(). This can be managed
51
51
  automatically by passing "reqrefs=True" and then using _incref() and
52
- _decref()` appropriately.
52
+ _decref() appropriately.
53
53
 
54
54
  "config" must be a valid interpreter config or the name of a
55
55
  predefined config ("isolated" or "legacy"). The default
@@ -143,12 +143,6 @@ def call(
143
143
 
144
144
  Call the provided object in the identified interpreter.
145
145
  Pass the given args and kwargs, if possible.
146
-
147
- "callable" may be a plain function with no free vars that takes
148
- no arguments.
149
-
150
- The function's code object is used and all its state
151
- is ignored, including its __globals__ dict.
152
146
  """
153
147
  ...
154
148
  def run_string(
@@ -30,8 +30,7 @@ data:
30
30
  DEFAULT_BUFFER_SIZE
31
31
 
32
32
  An int containing the default buffer size used by the module's buffered
33
- I/O classes. open() uses the file's blksize (as obtained by os.stat) if
34
- possible.
33
+ I/O classes.
35
34
  """
36
35
 
37
36
  import builtins
@@ -377,9 +376,14 @@ class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompat
377
376
  """
378
377
  Read at most size bytes, returned as bytes.
379
378
 
380
- Only makes one system call, so less data may be returned than requested.
381
- In non-blocking mode, returns None if no data is available.
382
- Return an empty bytes object at EOF.
379
+ If size is less than 0, read all bytes in the file making multiple read calls.
380
+ See ``FileIO.readall``.
381
+
382
+ Attempts to make only one system call, retrying only per PEP 475 (EINTR). This
383
+ means less data may be returned than requested.
384
+
385
+ In non-blocking mode, returns None if no data is available. Return an empty
386
+ bytes object at EOF.
383
387
  """
384
388
  ...
385
389
 
@@ -10,12 +10,11 @@ from typing_extensions import disjoint_base
10
10
  @disjoint_base
11
11
  class Profiler:
12
12
  """
13
- Profiler(timer=None, timeunit=None, subcalls=True, builtins=True)
13
+ Build a profiler object using the specified timer function.
14
14
 
15
- Builds a profiler object using the specified timer function.
16
15
  The default timer is a fast built-in one based on real time.
17
- For custom timer functions returning integers, timeunit can
18
- be a float specifying a scale (i.e. how long each integer unit
16
+ For custom timer functions returning integers, 'timeunit' can
17
+ be a float specifying a scale (that is, how long each integer unit
19
18
  is, in seconds).
20
19
  """
21
20
  def __init__(
@@ -50,28 +49,21 @@ class Profiler:
50
49
  ...
51
50
  def enable(self, subcalls: bool = True, builtins: bool = True) -> None:
52
51
  """
53
- enable(subcalls=True, builtins=True)
54
-
55
52
  Start collecting profiling information.
56
- If 'subcalls' is True, also records for each function
57
- statistics separated according to its current caller.
58
- If 'builtins' is True, records the time spent in
59
- built-in functions separately from their caller.
53
+
54
+ subcalls
55
+ If True, also records for each function
56
+ statistics separated according to its current caller.
57
+ builtins
58
+ If True, records the time spent in
59
+ built-in functions separately from their caller.
60
60
  """
61
61
  ...
62
62
  def disable(self) -> None:
63
- """
64
- disable()
65
-
66
- Stop collecting profiling information.
67
- """
63
+ """Stop collecting profiling information."""
68
64
  ...
69
65
  def clear(self) -> None:
70
- """
71
- clear()
72
-
73
- Clear all profiling information collected so far.
74
- """
66
+ """Clear all profiling information collected so far."""
75
67
  ...
76
68
 
77
69
  @final
@@ -264,5 +264,9 @@ def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool:
264
264
  ...
265
265
 
266
266
  if sys.version_info >= (3, 14):
267
- def is_none(a: object, /) -> TypeIs[None]: ...
268
- def is_not_none(a: _T | None, /) -> TypeIs[_T]: ...
267
+ def is_none(a: object, /) -> TypeIs[None]:
268
+ """Same as a is None."""
269
+ ...
270
+ def is_not_none(a: _T | None, /) -> TypeIs[_T]:
271
+ """Same as a is not None."""
272
+ ...
@@ -37,7 +37,7 @@ def dump(
37
37
 
38
38
  The optional *protocol* argument tells the pickler to use the given
39
39
  protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
40
- protocol is 4. It was introduced in Python 3.4, and is incompatible
40
+ protocol is 5. It was introduced in Python 3.8, and is incompatible
41
41
  with previous versions.
42
42
 
43
43
  Specifying a negative protocol version selects the highest protocol
@@ -66,7 +66,7 @@ def dumps(
66
66
 
67
67
  The optional *protocol* argument tells the pickler to use the given
68
68
  protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
69
- protocol is 4. It was introduced in Python 3.4, and is incompatible
69
+ protocol is 5. It was introduced in Python 3.8, and is incompatible
70
70
  with previous versions.
71
71
 
72
72
  Specifying a negative protocol version selects the highest protocol
@@ -159,7 +159,7 @@ class Pickler:
159
159
 
160
160
  The optional *protocol* argument tells the pickler to use the given
161
161
  protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
162
- protocol is 4. It was introduced in Python 3.4, and is incompatible
162
+ protocol is 5. It was introduced in Python 3.8, and is incompatible
163
163
  with previous versions.
164
164
 
165
165
  Specifying a negative protocol version selects the highest protocol