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
@@ -1,74 +1,74 @@
1
- import queue
2
- import sys
3
- from typing import Final, SupportsIndex
4
- from typing_extensions import Self
5
-
6
- if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <3.13
7
- from _interpqueues import QueueError as QueueError, QueueNotFoundError as QueueNotFoundError
8
-
9
- from . import _crossinterp
10
- from ._crossinterp import UNBOUND_ERROR as UNBOUND_ERROR, UNBOUND_REMOVE as UNBOUND_REMOVE, UnboundItem, _AnyUnbound
11
-
12
- __all__ = [
13
- "UNBOUND",
14
- "UNBOUND_ERROR",
15
- "UNBOUND_REMOVE",
16
- "ItemInterpreterDestroyed",
17
- "Queue",
18
- "QueueEmpty",
19
- "QueueError",
20
- "QueueFull",
21
- "QueueNotFoundError",
22
- "create",
23
- "list_all",
24
- ]
25
-
26
- class QueueEmpty(QueueError, queue.Empty): ...
27
- class QueueFull(QueueError, queue.Full): ...
28
- class ItemInterpreterDestroyed(QueueError, _crossinterp.ItemInterpreterDestroyed): ...
29
- UNBOUND: Final[UnboundItem]
30
-
31
- def create(maxsize: int = 0, *, unbounditems: _AnyUnbound = ...) -> Queue: ...
32
- def list_all() -> list[Queue]: ...
33
-
34
- class Queue:
35
- def __new__(cls, id: int, /) -> Self: ...
36
- def __del__(self) -> None: ...
37
- def __hash__(self) -> int: ...
38
- def __reduce__(self) -> tuple[type[Self], int]: ...
39
- @property
40
- def id(self) -> int: ...
41
- @property
42
- def unbounditems(self) -> _AnyUnbound: ...
43
- @property
44
- def maxsize(self) -> int: ...
45
- def empty(self) -> bool: ...
46
- def full(self) -> bool: ...
47
- def qsize(self) -> int: ...
48
- if sys.version_info >= (3, 14):
49
- def put(
50
- self,
51
- obj: object,
52
- block: bool = True,
53
- timeout: SupportsIndex | None = None,
54
- *,
55
- unbounditems: _AnyUnbound | None = None,
56
- _delay: float = 0.01,
57
- ) -> None: ...
58
- else:
59
- def put(
60
- self,
61
- obj: object,
62
- timeout: SupportsIndex | None = None,
63
- *,
64
- unbounditems: _AnyUnbound | None = None,
65
- _delay: float = 0.01,
66
- ) -> None: ...
67
-
68
- def put_nowait(self, obj: object, *, unbounditems: _AnyUnbound | None = None) -> None: ...
69
- if sys.version_info >= (3, 14):
70
- def get(self, block: bool = True, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
71
- else:
72
- def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
73
-
74
- def get_nowait(self) -> object: ...
1
+ import queue
2
+ import sys
3
+ from typing import Final, SupportsIndex
4
+ from typing_extensions import Self
5
+
6
+ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <3.13
7
+ from _interpqueues import QueueError as QueueError, QueueNotFoundError as QueueNotFoundError
8
+
9
+ from . import _crossinterp
10
+ from ._crossinterp import UNBOUND_ERROR as UNBOUND_ERROR, UNBOUND_REMOVE as UNBOUND_REMOVE, UnboundItem, _AnyUnbound
11
+
12
+ __all__ = [
13
+ "UNBOUND",
14
+ "UNBOUND_ERROR",
15
+ "UNBOUND_REMOVE",
16
+ "ItemInterpreterDestroyed",
17
+ "Queue",
18
+ "QueueEmpty",
19
+ "QueueError",
20
+ "QueueFull",
21
+ "QueueNotFoundError",
22
+ "create",
23
+ "list_all",
24
+ ]
25
+
26
+ class QueueEmpty(QueueError, queue.Empty): ...
27
+ class QueueFull(QueueError, queue.Full): ...
28
+ class ItemInterpreterDestroyed(QueueError, _crossinterp.ItemInterpreterDestroyed): ...
29
+ UNBOUND: Final[UnboundItem]
30
+
31
+ def create(maxsize: int = 0, *, unbounditems: _AnyUnbound = ...) -> Queue: ...
32
+ def list_all() -> list[Queue]: ...
33
+
34
+ class Queue:
35
+ def __new__(cls, id: int, /) -> Self: ...
36
+ def __del__(self) -> None: ...
37
+ def __hash__(self) -> int: ...
38
+ def __reduce__(self) -> tuple[type[Self], int]: ...
39
+ @property
40
+ def id(self) -> int: ...
41
+ @property
42
+ def unbounditems(self) -> _AnyUnbound: ...
43
+ @property
44
+ def maxsize(self) -> int: ...
45
+ def empty(self) -> bool: ...
46
+ def full(self) -> bool: ...
47
+ def qsize(self) -> int: ...
48
+ if sys.version_info >= (3, 14):
49
+ def put(
50
+ self,
51
+ obj: object,
52
+ block: bool = True,
53
+ timeout: SupportsIndex | None = None,
54
+ *,
55
+ unbounditems: _AnyUnbound | None = None,
56
+ _delay: float = 0.01,
57
+ ) -> None: ...
58
+ else:
59
+ def put(
60
+ self,
61
+ obj: object,
62
+ timeout: SupportsIndex | None = None,
63
+ *,
64
+ unbounditems: _AnyUnbound | None = None,
65
+ _delay: float = 0.01,
66
+ ) -> None: ...
67
+
68
+ def put_nowait(self, obj: object, *, unbounditems: _AnyUnbound | None = None) -> None: ...
69
+ if sys.version_info >= (3, 14):
70
+ def get(self, block: bool = True, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
71
+ else:
72
+ def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
73
+
74
+ def get_nowait(self) -> object: ...
@@ -219,7 +219,13 @@ if sys.version_info >= (3, 14):
219
219
  class py_object(_CanCastTo, _SimpleCData[_T]):
220
220
  _type_: ClassVar[Literal["O"]]
221
221
  if sys.version_info >= (3, 14):
222
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
222
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
223
+ """
224
+ Represent a PEP 585 generic type
225
+
226
+ E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
227
+ """
228
+ ...
223
229
 
224
230
  class c_bool(_SimpleCData[bool]):
225
231
  _type_: ClassVar[Literal["?"]]
@@ -116,7 +116,9 @@ class date:
116
116
 
117
117
  if sys.version_info >= (3, 14):
118
118
  @classmethod
119
- def strptime(cls, date_string: str, format: str, /) -> Self: ...
119
+ def strptime(cls, date_string: str, format: str, /) -> Self:
120
+ """string, format -> new date parsed from a string (like time.strptime())."""
121
+ ...
120
122
 
121
123
  # On <3.12, the name of the parameter in the pure-Python implementation
122
124
  # didn't match the name in the C implementation,
@@ -261,7 +263,9 @@ class time:
261
263
 
262
264
  if sys.version_info >= (3, 14):
263
265
  @classmethod
264
- def strptime(cls, date_string: str, format: str, /) -> Self: ...
266
+ def strptime(cls, date_string: str, format: str, /) -> Self:
267
+ """string, format -> new time parsed from a string (like time.strptime())."""
268
+ ...
265
269
 
266
270
  # On <3.12, the name of the parameter in the pure-Python implementation
267
271
  # didn't match the name in the C implementation,
@@ -73,7 +73,18 @@ class Decimal:
73
73
  def __new__(cls, value: _DecimalNew = "0", context: Context | None = None) -> Self: ...
74
74
  if sys.version_info >= (3, 14):
75
75
  @classmethod
76
- def from_number(cls, number: Decimal | float, /) -> Self: ...
76
+ def from_number(cls, number: Decimal | float, /) -> Self:
77
+ """
78
+ Class method that converts a real number to a decimal number, exactly.
79
+
80
+ >>> Decimal.from_number(314) # int
81
+ Decimal('314')
82
+ >>> Decimal.from_number(0.1) # float
83
+ Decimal('0.1000000000000000055511151231257827021181583404541015625')
84
+ >>> Decimal.from_number(Decimal('3.14')) # another decimal instance
85
+ Decimal('3.14')
86
+ """
87
+ ...
77
88
 
78
89
  @classmethod
79
90
  def from_float(cls, f: float, /) -> Self:
@@ -14,7 +14,9 @@ def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> N
14
14
  ...
15
15
 
16
16
  if sys.version_info >= (3, 14):
17
- def dump_c_stack(file: FileDescriptorLike = ...) -> None: ...
17
+ def dump_c_stack(file: FileDescriptorLike = ...) -> None:
18
+ """Dump the C stack of the current thread."""
19
+ ...
18
20
 
19
21
  def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None:
20
22
  """
@@ -24,13 +26,13 @@ def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescripto
24
26
  ...
25
27
 
26
28
  if sys.version_info >= (3, 14):
27
- def enable(file: FileDescriptorLike = ..., all_threads: bool = ..., c_stack: bool = True) -> None: ...
28
-
29
- else:
30
- def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None:
29
+ def enable(file: FileDescriptorLike = ..., all_threads: bool = ..., c_stack: bool = True) -> None:
31
30
  """Enable the fault handler."""
32
31
  ...
33
32
 
33
+ else:
34
+ def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ...
35
+
34
36
  def is_enabled() -> bool:
35
37
  """Check if the handler is enabled."""
36
38
  ...
@@ -33,14 +33,8 @@ _RWrapper = TypeVar("_RWrapper")
33
33
 
34
34
  if sys.version_info >= (3, 14):
35
35
  @overload
36
- def reduce(function: Callable[[_T, _S], _T], iterable: Iterable[_S], /, initial: _T) -> _T: ...
37
-
38
- else:
39
- @overload
40
- def reduce(function: Callable[[_T, _S], _T], iterable: Iterable[_S], initial: _T, /) -> _T:
36
+ def reduce(function: Callable[[_T, _S], _T], iterable: Iterable[_S], /, initial: _T) -> _T:
41
37
  """
42
- reduce(function, iterable[, initial], /) -> value
43
-
44
38
  Apply a function of two arguments cumulatively to the items of an iterable, from left to right.
45
39
 
46
40
  This effectively reduces the iterable to a single value. If initial is present,
@@ -52,11 +46,13 @@ else:
52
46
  """
53
47
  ...
54
48
 
49
+ else:
50
+ @overload
51
+ def reduce(function: Callable[[_T, _S], _T], iterable: Iterable[_S], initial: _T, /) -> _T: ...
52
+
55
53
  @overload
56
54
  def reduce(function: Callable[[_T, _T], _T], iterable: Iterable[_T], /) -> _T:
57
55
  """
58
- reduce(function, iterable[, initial], /) -> value
59
-
60
56
  Apply a function of two arguments cumulatively to the items of an iterable, from left to right.
61
57
 
62
58
  This effectively reduces the iterable to a single value. If initial is present,
@@ -10,7 +10,7 @@ get_stats() -- Return list of dictionaries containing per-generation stats.
10
10
  set_debug() -- Set debugging flags.
11
11
  get_debug() -- Get debugging flags.
12
12
  set_threshold() -- Set the collection thresholds.
13
- get_threshold() -- Return the current the collection thresholds.
13
+ get_threshold() -- Return the current collection thresholds.
14
14
  get_objects() -- Return a list of all objects tracked by the collector.
15
15
  is_tracked() -- Returns true if a given object is tracked.
16
16
  is_finalized() -- Returns true if a given object has been already finalized.
@@ -59,11 +59,7 @@ _Marshallable: TypeAlias = (
59
59
  )
60
60
 
61
61
  if sys.version_info >= (3, 14):
62
- def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 5, /, *, allow_code: bool = True) -> None: ...
63
- def dumps(value: _Marshallable, version: int = 5, /, *, allow_code: bool = True) -> bytes: ...
64
-
65
- elif sys.version_info >= (3, 13):
66
- def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /, *, allow_code: bool = True) -> None:
62
+ def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 5, /, *, allow_code: bool = True) -> None:
67
63
  """
68
64
  Write the value on the open file.
69
65
 
@@ -81,7 +77,7 @@ elif sys.version_info >= (3, 13):
81
77
  to the file. The object will not be properly read back by load().
82
78
  """
83
79
  ...
84
- def dumps(value: _Marshallable, version: int = 4, /, *, allow_code: bool = True) -> bytes:
80
+ def dumps(value: _Marshallable, version: int = 5, /, *, allow_code: bool = True) -> bytes:
85
81
  """
86
82
  Return the bytes object that would be written to a file by dump(value, file).
87
83
 
@@ -97,6 +93,10 @@ elif sys.version_info >= (3, 13):
97
93
  """
98
94
  ...
99
95
 
96
+ elif sys.version_info >= (3, 13):
97
+ def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /, *, allow_code: bool = True) -> None: ...
98
+ def dumps(value: _Marshallable, version: int = 4, /, *, allow_code: bool = True) -> bytes: ...
99
+
100
100
  else:
101
101
  def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /) -> None: ...
102
102
  def dumps(value: _Marshallable, version: int = 4, /) -> bytes: ...
@@ -204,8 +204,6 @@ def gcd(*integers: SupportsIndex) -> int:
204
204
  ...
205
205
  def hypot(*coordinates: _SupportsFloatOrIndex) -> float:
206
206
  """
207
- hypot(*coordinates) -> value
208
-
209
207
  Multidimensional Euclidean distance from the origin to a point.
210
208
 
211
209
  Roughly equivalent to:
@@ -413,7 +411,7 @@ if sys.version_info >= (3, 12):
413
411
 
414
412
  Roughly equivalent to:
415
413
 
416
- sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))
414
+ sum(map(operator.mul, p, q, strict=True))
417
415
 
418
416
  For float and mixed int/float inputs, the intermediate products
419
417
  and sums are computed with extended precision.
@@ -173,7 +173,9 @@ if sys.version_info >= (3, 14):
173
173
  def __lt__(self, value: AbstractSet[object], /) -> bool: ...
174
174
  def __ge__(self, value: AbstractSet[object], /) -> bool: ...
175
175
  def __gt__(self, value: AbstractSet[object], /) -> bool: ...
176
- def __eq__(self, value: object, /) -> bool: ...
176
+ def __eq__(self, value: object, /) -> bool:
177
+ """Return self==value."""
178
+ ...
177
179
  def __rand__(self, value: AbstractSet[object], /) -> set[_T]: ...
178
180
  def __ror__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc]
179
181
  def __rsub__(self, value: AbstractSet[_T], /) -> set[_T]: ...
@@ -175,18 +175,10 @@ class Rational(Real):
175
175
  __slots__ = ()
176
176
  @property
177
177
  @abstractmethod
178
- def numerator(self) -> _IntegralLike:
179
- """The numerator of a rational number in lowest terms."""
180
- ...
178
+ def numerator(self) -> _IntegralLike: ...
181
179
  @property
182
180
  @abstractmethod
183
- def denominator(self) -> _IntegralLike:
184
- """
185
- The denominator of a rational number in lowest terms.
186
-
187
- This denominator should be positive.
188
- """
189
- ...
181
+ def denominator(self) -> _IntegralLike: ...
190
182
  def __float__(self) -> float: ...
191
183
 
192
184
  # See comment at the top of the file
@@ -1625,7 +1625,21 @@ if sys.platform != "win32":
1625
1625
  ...
1626
1626
 
1627
1627
  if sys.version_info >= (3, 14):
1628
- def readinto(fd: int, buffer: ReadableBuffer, /) -> int: ...
1628
+ def readinto(fd: int, buffer: ReadableBuffer, /) -> int:
1629
+ """
1630
+ Read into a buffer object from a file descriptor.
1631
+
1632
+ The buffer should be mutable and bytes-like. On success, returns the number of
1633
+ bytes read. Less bytes may be read than the size of the buffer. The underlying
1634
+ system call will be retried when interrupted by a signal, unless the signal
1635
+ handler raises an exception. Other errors will not be retried and an error will
1636
+ be raised.
1637
+
1638
+ Returns 0 if *fd* is at end of file or if the provided *buffer* has length 0
1639
+ (which can be used to check for errors without reading data). Never returns
1640
+ negative.
1641
+ """
1642
+ ...
1629
1643
 
1630
1644
  @final
1631
1645
  class terminal_size(structseq[int], tuple[int, int]):
@@ -237,7 +237,12 @@ class Path(PurePath):
237
237
 
238
238
  if sys.version_info >= (3, 14):
239
239
  @property
240
- def info(self) -> PathInfo: ...
240
+ def info(self) -> PathInfo:
241
+ """
242
+ A PathInfo object that exposes the file type and other file attributes
243
+ of this path.
244
+ """
245
+ ...
241
246
  @overload
242
247
  def move_into(self, target_dir: _PathT) -> _PathT: ... # type: ignore[overload-overlap]
243
248
  @overload
@@ -1,8 +1,8 @@
1
- from typing import Protocol, runtime_checkable
2
-
3
- @runtime_checkable
4
- class PathInfo(Protocol):
5
- def exists(self, *, follow_symlinks: bool = True) -> bool: ...
6
- def is_dir(self, *, follow_symlinks: bool = True) -> bool: ...
7
- def is_file(self, *, follow_symlinks: bool = True) -> bool: ...
8
- def is_symlink(self) -> bool: ...
1
+ from typing import Protocol, runtime_checkable
2
+
3
+ @runtime_checkable
4
+ class PathInfo(Protocol):
5
+ def exists(self, *, follow_symlinks: bool = True) -> bool: ...
6
+ def is_dir(self, *, follow_symlinks: bool = True) -> bool: ...
7
+ def is_file(self, *, follow_symlinks: bool = True) -> bool: ...
8
+ def is_symlink(self) -> bool: ...
@@ -26,7 +26,7 @@ class XMLParserType:
26
26
  """
27
27
  Parse XML data.
28
28
 
29
- `isfinal' should be true at end of input.
29
+ 'isfinal' should be true at end of input.
30
30
  """
31
31
  ...
32
32
  def ParseFile(self, file: SupportsRead[bytes], /) -> int:
@@ -1,36 +1,46 @@
1
- from collections.abc import Iterator
2
- from types import GenericAlias
3
- from typing import Any, Literal, TypeVar, final, overload
4
-
5
- _T = TypeVar("_T")
6
-
7
- @final
8
- class Template: # TODO: consider making `Template` generic on `TypeVarTuple`
9
- strings: tuple[str, ...]
10
- interpolations: tuple[Interpolation, ...]
11
-
12
- def __new__(cls, *args: str | Interpolation) -> Template: ...
13
- def __iter__(self) -> Iterator[str | Interpolation]: ...
14
- def __add__(self, other: Template, /) -> Template: ...
15
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
16
- @property
17
- def values(self) -> tuple[Any, ...]: ... # Tuple of interpolation values, which can have any type
18
-
19
- @final
20
- class Interpolation:
21
- value: Any # TODO: consider making `Interpolation` generic in runtime
22
- expression: str
23
- conversion: Literal["a", "r", "s"] | None
24
- format_spec: str
25
-
26
- __match_args__ = ("value", "expression", "conversion", "format_spec")
27
-
28
- def __new__(
29
- cls, value: Any, expression: str = "", conversion: Literal["a", "r", "s"] | None = None, format_spec: str = ""
30
- ) -> Interpolation: ...
31
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
32
-
33
- @overload
34
- def convert(obj: _T, /, conversion: None) -> _T: ...
35
- @overload
36
- def convert(obj: object, /, conversion: Literal["r", "s", "a"]) -> str: ...
1
+ from collections.abc import Iterator
2
+ from types import GenericAlias
3
+ from typing import Any, Literal, TypeVar, final, overload
4
+
5
+ _T = TypeVar("_T")
6
+
7
+ @final
8
+ class Template: # TODO: consider making `Template` generic on `TypeVarTuple`
9
+ strings: tuple[str, ...]
10
+ interpolations: tuple[Interpolation, ...]
11
+
12
+ def __new__(cls, *args: str | Interpolation) -> Template: ...
13
+ def __iter__(self) -> Iterator[str | Interpolation]:
14
+ """Implement iter(self)."""
15
+ ...
16
+ def __add__(self, other: Template, /) -> Template:
17
+ """Return self+value."""
18
+ ...
19
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
20
+ """See PEP 585"""
21
+ ...
22
+ @property
23
+ def values(self) -> tuple[Any, ...]:
24
+ """Values of interpolations"""
25
+ ...
26
+
27
+ @final
28
+ class Interpolation:
29
+ value: Any # TODO: consider making `Interpolation` generic in runtime
30
+ expression: str
31
+ conversion: Literal["a", "r", "s"] | None
32
+ format_spec: str
33
+
34
+ __match_args__ = ("value", "expression", "conversion", "format_spec")
35
+
36
+ def __new__(
37
+ cls, value: Any, expression: str = "", conversion: Literal["a", "r", "s"] | None = None, format_spec: str = ""
38
+ ) -> Interpolation: ...
39
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
40
+ """See PEP 585"""
41
+ ...
42
+
43
+ @overload
44
+ def convert(obj: _T, /, conversion: None) -> _T: ...
45
+ @overload
46
+ def convert(obj: object, /, conversion: Literal["r", "s", "a"]) -> str: ...
@@ -813,5 +813,28 @@ if sys.version_info >= (3, 12):
813
813
  monitoring = _monitoring
814
814
 
815
815
  if sys.version_info >= (3, 14):
816
- def is_remote_debug_enabled() -> bool: ...
817
- def remote_exec(pid: int, script: StrOrBytesPath) -> None: ...
816
+ def is_remote_debug_enabled() -> bool:
817
+ """Return True if remote debugging is enabled, False otherwise."""
818
+ ...
819
+ def remote_exec(pid: int, script: StrOrBytesPath) -> None:
820
+ """
821
+ Executes a file containing Python code in a given remote Python process.
822
+
823
+ This function returns immediately, and the code will be executed by the
824
+ target process's main thread at the next available opportunity, similarly
825
+ to how signals are handled. There is no interface to determine when the
826
+ code has been executed. The caller is responsible for making sure that
827
+ the file still exists whenever the remote process tries to read it and that
828
+ it hasn't been overwritten.
829
+
830
+ The remote process must be running a CPython interpreter of the same major
831
+ and minor version as the local process. If either the local or remote
832
+ interpreter is pre-release (alpha, beta, or release candidate) then the
833
+ local and remote interpreters must be the same exact version.
834
+
835
+ Args:
836
+ pid (int): The process ID of the target Python process.
837
+ script (str|bytes): The path to a file containing
838
+ the Python code to be executed.
839
+ """
840
+ ...
@@ -300,7 +300,13 @@ class Event(Generic[_W_co]):
300
300
  widget: _W_co
301
301
  delta: int
302
302
  if sys.version_info >= (3, 14):
303
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
303
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
304
+ """
305
+ Represent a PEP 585 generic type
306
+
307
+ E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
308
+ """
309
+ ...
304
310
 
305
311
  def NoDefaultRoot() -> None: ...
306
312
 
@@ -808,29 +808,43 @@ class FrameType:
808
808
  @property
809
809
  def f_back(self) -> FrameType | None: ...
810
810
  @property
811
- def f_builtins(self) -> dict[str, Any]: ...
811
+ def f_builtins(self) -> dict[str, Any]:
812
+ """Return the built-in variables in the frame."""
813
+ ...
812
814
  @property
813
- def f_code(self) -> CodeType: ...
815
+ def f_code(self) -> CodeType:
816
+ """Return the code object being executed in this frame."""
817
+ ...
814
818
  @property
815
- def f_globals(self) -> dict[str, Any]: ...
819
+ def f_globals(self) -> dict[str, Any]:
820
+ """Return the global variables in the frame."""
821
+ ...
816
822
  @property
817
- def f_lasti(self) -> int: ...
823
+ def f_lasti(self) -> int:
824
+ """Return the index of the last attempted instruction in the frame."""
825
+ ...
818
826
  # see discussion in #6769: f_lineno *can* sometimes be None,
819
827
  # but you should probably file a bug report with CPython if you encounter it being None in the wild.
820
828
  # An `int | None` annotation here causes too many false-positive errors, so applying `int | Any`.
821
829
  @property
822
- def f_lineno(self) -> int | MaybeNone: ...
830
+ def f_lineno(self) -> int | MaybeNone:
831
+ """Return the current line number in the frame."""
832
+ ...
823
833
  @property
824
- def f_locals(self) -> dict[str, Any]: ...
834
+ def f_locals(self) -> dict[str, Any]:
835
+ """Return the mapping used by the frame to look up local variables."""
836
+ ...
825
837
  f_trace: Callable[[FrameType, str, Any], Any] | None
826
838
  f_trace_lines: bool
827
839
  f_trace_opcodes: bool
828
840
  def clear(self) -> None:
829
- """F.clear(): clear most references held by the frame"""
841
+ """Clear all references held by the frame."""
830
842
  ...
831
843
  if sys.version_info >= (3, 14):
832
844
  @property
833
- def f_generator(self) -> GeneratorType[Any, Any, Any] | CoroutineType[Any, Any, Any] | None: ...
845
+ def f_generator(self) -> GeneratorType[Any, Any, Any] | CoroutineType[Any, Any, Any] | None:
846
+ """Return the generator or coroutine associated with this frame, or None."""
847
+ ...
834
848
 
835
849
  @final
836
850
  class GetSetDescriptorType:
@@ -2,10 +2,10 @@
2
2
  This module provides access to the Unicode Character Database which
3
3
  defines character properties for all Unicode characters. The data in
4
4
  this database is based on the UnicodeData.txt file version
5
- 15.1.0 which is publicly available from ftp://ftp.unicode.org/.
5
+ 16.0.0 which is publicly available from ftp://ftp.unicode.org/.
6
6
 
7
7
  The module uses the same names and symbols as defined by the
8
- UnicodeData File Format 15.1.0.
8
+ UnicodeData File Format 16.0.0.
9
9
  """
10
10
 
11
11
  import sys
@@ -10,6 +10,10 @@ SND_NODEFAULT - Do not play a default beep if the sound can not be found
10
10
  SND_NOSTOP - Do not interrupt any sounds currently playing
11
11
  SND_NOWAIT - Return immediately if the sound driver is busy
12
12
  SND_APPLICATION - sound is an application-specific alias in the registry.
13
+ SND_SENTRY - Triggers a SoundSentry event when the sound is played.
14
+ SND_SYNC - Play the sound synchronously, default behavior.
15
+ SND_SYSTEM - Assign sound to the audio session for system notification sounds.
16
+
13
17
  Beep(frequency, duration) - Make a beep through the PC speaker.
14
18
  MessageBeep(type) - Call Windows MessageBeep.
15
19
  """