basedpyright 1.16.0 → 1.17.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 (164) 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/commit.txt +1 -1
  6. package/dist/typeshed-fallback/stdlib/_ast.pyi +5 -3
  7. package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +6 -3
  8. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +2 -2
  9. package/dist/typeshed-fallback/stdlib/_operator.pyi +5 -1
  10. package/dist/typeshed-fallback/stdlib/_stat.pyi +6 -6
  11. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +2 -2
  12. package/dist/typeshed-fallback/stdlib/argparse.pyi +11 -1
  13. package/dist/typeshed-fallback/stdlib/array.pyi +3 -3
  14. package/dist/typeshed-fallback/stdlib/ast.pyi +18 -17
  15. package/dist/typeshed-fallback/stdlib/builtins.pyi +7 -5
  16. package/dist/typeshed-fallback/stdlib/cmd.pyi +2 -1
  17. package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +2 -1
  18. package/dist/typeshed-fallback/stdlib/contextlib.pyi +2 -0
  19. package/dist/typeshed-fallback/stdlib/crypt.pyi +6 -5
  20. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +5 -1
  21. package/dist/typeshed-fallback/stdlib/datetime.pyi +2 -2
  22. package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +120 -0
  23. package/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi +48 -0
  24. package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +2 -2
  25. package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +2 -2
  26. package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +9 -4
  27. package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +2 -2
  28. package/dist/typeshed-fallback/stdlib/distutils/core.pyi +2 -2
  29. package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +5 -5
  30. package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +3 -1
  31. package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +149 -4
  32. package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +6 -6
  33. package/dist/typeshed-fallback/stdlib/distutils/log.pyi +6 -6
  34. package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +7 -7
  35. package/dist/typeshed-fallback/stdlib/email/message.pyi +2 -1
  36. package/dist/typeshed-fallback/stdlib/email/utils.pyi +4 -1
  37. package/dist/typeshed-fallback/stdlib/filecmp.pyi +18 -7
  38. package/dist/typeshed-fallback/stdlib/ftplib.pyi +1 -1
  39. package/dist/typeshed-fallback/stdlib/json/encoder.pyi +6 -6
  40. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +31 -36
  41. package/dist/typeshed-fallback/stdlib/marshal.pyi +2 -2
  42. package/dist/typeshed-fallback/stdlib/math.pyi +3 -3
  43. package/dist/typeshed-fallback/stdlib/operator.pyi +3 -0
  44. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +4 -2
  45. package/dist/typeshed-fallback/stdlib/pathlib.pyi +24 -2
  46. package/dist/typeshed-fallback/stdlib/poplib.pyi +2 -1
  47. package/dist/typeshed-fallback/stdlib/pty.pyi +8 -3
  48. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +3 -3
  49. package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +45 -43
  50. package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +12 -10
  51. package/dist/typeshed-fallback/stdlib/select.pyi +1 -1
  52. package/dist/typeshed-fallback/stdlib/signal.pyi +1 -1
  53. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +8 -2
  54. package/dist/typeshed-fallback/stdlib/tarfile.pyi +1 -1
  55. package/dist/typeshed-fallback/stdlib/time.pyi +5 -5
  56. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +28 -4
  57. package/dist/typeshed-fallback/stdlib/tkinter/constants.pyi +6 -6
  58. package/dist/typeshed-fallback/stdlib/tkinter/dialog.pyi +2 -2
  59. package/dist/typeshed-fallback/stdlib/tkinter/messagebox.pyi +17 -17
  60. package/dist/typeshed-fallback/stdlib/tkinter/ttk.pyi +3 -1
  61. package/dist/typeshed-fallback/stdlib/typing.pyi +2 -1
  62. package/dist/typeshed-fallback/stdlib/urllib/request.pyi +1 -0
  63. package/dist/typeshed-fallback/stdlib/zipfile/__init__.pyi +78 -3
  64. package/dist/typeshed-fallback/stdlib/zipfile/_path.pyi +1 -0
  65. package/dist/typeshed-fallback/stubs/JACK-Client/METADATA.toml +3 -1
  66. package/dist/typeshed-fallback/stubs/cachetools/METADATA.toml +1 -1
  67. package/dist/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi +2 -2
  68. package/dist/typeshed-fallback/stubs/corus/METADATA.toml +2 -0
  69. package/dist/typeshed-fallback/stubs/corus/corus/__init__.pyi +1 -0
  70. package/dist/typeshed-fallback/stubs/corus/corus/io.pyi +21 -0
  71. package/dist/typeshed-fallback/stubs/corus/corus/readme.pyi +17 -0
  72. package/dist/typeshed-fallback/stubs/corus/corus/record.pyi +8 -0
  73. package/dist/typeshed-fallback/stubs/corus/corus/sources/__init__.pyi +23 -0
  74. package/dist/typeshed-fallback/stubs/corus/corus/sources/bsnlp.pyi +75 -0
  75. package/dist/typeshed-fallback/stubs/corus/corus/sources/buriy.pyi +18 -0
  76. package/dist/typeshed-fallback/stubs/corus/corus/sources/corpora.pyi +50 -0
  77. package/dist/typeshed-fallback/stubs/corus/corus/sources/factru.pyi +74 -0
  78. package/dist/typeshed-fallback/stubs/corus/corus/sources/gareev.pyi +21 -0
  79. package/dist/typeshed-fallback/stubs/corus/corus/sources/gramru.pyi +1 -0
  80. package/dist/typeshed-fallback/stubs/corus/corus/sources/lenta.pyi +19 -0
  81. package/dist/typeshed-fallback/stubs/corus/corus/sources/librusec.pyi +14 -0
  82. package/dist/typeshed-fallback/stubs/corus/corus/sources/meta.pyi +54 -0
  83. package/dist/typeshed-fallback/stubs/corus/corus/sources/mokoron.pyi +28 -0
  84. package/dist/typeshed-fallback/stubs/corus/corus/sources/morphoru.pyi +24 -0
  85. package/dist/typeshed-fallback/stubs/corus/corus/sources/ne5.pyi +28 -0
  86. package/dist/typeshed-fallback/stubs/corus/corus/sources/ods.pyi +46 -0
  87. package/dist/typeshed-fallback/stubs/corus/corus/sources/omnia.pyi +49 -0
  88. package/dist/typeshed-fallback/stubs/corus/corus/sources/persons.pyi +27 -0
  89. package/dist/typeshed-fallback/stubs/corus/corus/sources/ria.pyi +21 -0
  90. package/dist/typeshed-fallback/stubs/corus/corus/sources/rudrec.pyi +27 -0
  91. package/dist/typeshed-fallback/stubs/corus/corus/sources/russe.pyi +16 -0
  92. package/dist/typeshed-fallback/stubs/corus/corus/sources/simlex.pyi +14 -0
  93. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/__init__.pyi +10 -0
  94. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/arzamas.pyi +6 -0
  95. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/common.pyi +77 -0
  96. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/fontanka.pyi +6 -0
  97. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/interfax.pyi +6 -0
  98. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/kp.pyi +6 -0
  99. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/lenta.pyi +6 -0
  100. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/magazines.pyi +6 -0
  101. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/nplus1.pyi +6 -0
  102. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/proza.pyi +8 -0
  103. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/social.pyi +15 -0
  104. package/dist/typeshed-fallback/stubs/corus/corus/sources/taiga/subtitles.pyi +6 -0
  105. package/dist/typeshed-fallback/stubs/corus/corus/sources/toloka.pyi +28 -0
  106. package/dist/typeshed-fallback/stubs/corus/corus/sources/ud.pyi +29 -0
  107. package/dist/typeshed-fallback/stubs/corus/corus/sources/wiki.pyi +20 -0
  108. package/dist/typeshed-fallback/stubs/corus/corus/sources/wikiner.pyi +19 -0
  109. package/dist/typeshed-fallback/stubs/corus/corus/third/WikiExtractor.pyi +227 -0
  110. package/dist/typeshed-fallback/stubs/corus/corus/third/__init__.pyi +0 -0
  111. package/dist/typeshed-fallback/stubs/corus/corus/zip.pyi +28 -0
  112. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi +2 -2
  113. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +1 -1
  114. package/dist/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi +2 -2
  115. package/dist/typeshed-fallback/stubs/influxdb-client/METADATA.toml +1 -1
  116. package/dist/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi +1 -1
  117. package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +3 -2
  118. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/digraph.pyi +14 -14
  119. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi +15 -9
  120. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/multidigraph.pyi +17 -4
  121. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/multigraph.pyi +4 -0
  122. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/__init__.pyi +2 -0
  123. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi +3 -1
  124. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +4 -5
  125. package/dist/typeshed-fallback/stubs/passlib/passlib/utils/handlers.pyi +6 -2
  126. package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +1 -1
  127. package/dist/typeshed-fallback/stubs/polib/polib.pyi +4 -2
  128. package/dist/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi +1 -1
  129. package/dist/typeshed-fallback/stubs/pyflakes/pyflakes/checker.pyi +2 -2
  130. package/dist/typeshed-fallback/stubs/pygit2/pygit2/utils.pyi +2 -2
  131. package/dist/typeshed-fallback/stubs/pyinstaller/METADATA.toml +1 -5
  132. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +0 -1
  133. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi +2 -0
  134. package/dist/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi +2 -2
  135. package/dist/typeshed-fallback/stubs/redis/redis/client.pyi +24 -8
  136. package/dist/typeshed-fallback/stubs/reportlab/reportlab/platypus/doctemplate.pyi +7 -1
  137. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +3 -1
  138. package/dist/typeshed-fallback/stubs/seaborn/seaborn/_core/plot.pyi +1 -1
  139. package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +136 -4
  140. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +2 -0
  141. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi +6 -4
  142. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +3 -3
  143. package/dist/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi +185 -0
  144. package/dist/typeshed-fallback/stubs/setuptools/setuptools/wheel.pyi +1 -1
  145. package/dist/typeshed-fallback/stubs/shapely/METADATA.toml +3 -1
  146. package/package.json +1 -1
  147. package/dist/typeshed-fallback/stubs/flake8-2020/METADATA.toml +0 -2
  148. package/dist/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi +0 -26
  149. package/dist/typeshed-fallback/stubs/paho-mqtt/METADATA.toml +0 -3
  150. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/__init__.pyi +0 -1
  151. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/client.pyi +0 -331
  152. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/matcher.pyi +0 -11
  153. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/packettypes.pyi +0 -19
  154. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/properties.pyi +0 -38
  155. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/publish.pyi +0 -63
  156. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/reasoncodes.pyi +0 -13
  157. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribe.pyi +0 -39
  158. package/dist/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribeoptions.pyi +0 -24
  159. package/dist/typeshed-fallback/stubs/python-slugify/METADATA.toml +0 -3
  160. package/dist/typeshed-fallback/stubs/python-slugify/slugify/__init__.pyi +0 -12
  161. package/dist/typeshed-fallback/stubs/python-slugify/slugify/__version__.pyi +0 -8
  162. package/dist/typeshed-fallback/stubs/python-slugify/slugify/slugify.pyi +0 -20
  163. package/dist/typeshed-fallback/stubs/python-slugify/slugify/special.pyi +0 -8
  164. /package/dist/typeshed-fallback/stubs/{paho-mqtt/paho/__init__.pyi → corus/corus/path.pyi} +0 -0
@@ -1 +1 @@
1
- 7eac47455ae5c9cec6edea0b8496d50299439ae2
1
+ a7ff1be4394cef089dd62090a2e2ad10cc77cfe6
@@ -753,9 +753,11 @@ class Constant(expr):
753
753
  __match_args__ = ("value", "kind")
754
754
  value: Any # None, str, bytes, bool, int, float, complex, Ellipsis
755
755
  kind: str | None
756
- # Aliases for value, for backwards compatibility
757
- s: Any
758
- n: int | float | complex
756
+ if sys.version_info < (3, 14):
757
+ # Aliases for value, for backwards compatibility
758
+ s: Any
759
+ n: int | float | complex
760
+
759
761
  def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
760
762
 
761
763
  class NamedExpr(expr):
@@ -1,13 +1,12 @@
1
1
  import sys
2
2
  from abc import abstractmethod
3
3
  from types import MappingProxyType
4
- from typing import ( # noqa: Y022,Y038,Y057
4
+ from typing import ( # noqa: Y022,Y038
5
5
  AbstractSet as Set,
6
6
  AsyncGenerator as AsyncGenerator,
7
7
  AsyncIterable as AsyncIterable,
8
8
  AsyncIterator as AsyncIterator,
9
9
  Awaitable as Awaitable,
10
- ByteString as ByteString,
11
10
  Callable as Callable,
12
11
  Collection as Collection,
13
12
  Container as Container,
@@ -59,8 +58,12 @@ __all__ = [
59
58
  "ValuesView",
60
59
  "Sequence",
61
60
  "MutableSequence",
62
- "ByteString",
63
61
  ]
62
+ if sys.version_info < (3, 14):
63
+ from typing import ByteString as ByteString # noqa: Y057
64
+
65
+ __all__ += ["ByteString"]
66
+
64
67
  if sys.version_info >= (3, 12):
65
68
  __all__ += ["Buffer"]
66
69
 
@@ -53,8 +53,8 @@ class _CDataMeta(type):
53
53
  # By default mypy complains about the following two methods, because strictly speaking cls
54
54
  # might not be a Type[_CT]. However this can never actually happen, because the only class that
55
55
  # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here.
56
- def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc]
57
- def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc]
56
+ def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
57
+ def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
58
58
 
59
59
  class _CData(metaclass=_CDataMeta):
60
60
  _b_base_: int
@@ -12,7 +12,7 @@ import sys
12
12
  from _typeshed import SupportsGetItem
13
13
  from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence
14
14
  from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, SupportsIndex, TypeVar, final, overload
15
- from typing_extensions import ParamSpec, TypeAlias, TypeVarTuple, Unpack
15
+ from typing_extensions import ParamSpec, TypeAlias, TypeIs, TypeVarTuple, Unpack
16
16
 
17
17
  _R = TypeVar("_R")
18
18
  _T = TypeVar("_T")
@@ -297,3 +297,7 @@ def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool:
297
297
  types and lengths of a and b--but not their values.
298
298
  """
299
299
  ...
300
+
301
+ if sys.version_info >= (3, 14):
302
+ def is_none(a: object, /) -> TypeIs[None]: ...
303
+ def is_not_none(a: _T | None, /) -> TypeIs[_T]: ...
@@ -89,9 +89,9 @@ S_IFDIR: Final = 0o040000
89
89
 
90
90
  # These are 0 on systems that don't support the specific kind of file.
91
91
  # Example: Linux doesn't support door files, so S_IFDOOR is 0 on linux.
92
- S_IFDOOR: int
93
- S_IFPORT: int
94
- S_IFWHT: int
92
+ S_IFDOOR: Final[int]
93
+ S_IFPORT: Final[int]
94
+ S_IFWHT: Final[int]
95
95
 
96
96
  S_ISUID: Final = 0o4000
97
97
  S_ISGID: Final = 0o2000
@@ -206,9 +206,9 @@ def filemode(mode: int, /) -> str:
206
206
  ...
207
207
 
208
208
  if sys.platform == "win32":
209
- IO_REPARSE_TAG_SYMLINK: int
210
- IO_REPARSE_TAG_MOUNT_POINT: int
211
- IO_REPARSE_TAG_APPEXECLINK: int
209
+ IO_REPARSE_TAG_SYMLINK: Final = 0xA000000C
210
+ IO_REPARSE_TAG_MOUNT_POINT: Final = 0xA0000003
211
+ IO_REPARSE_TAG_APPEXECLINK: Final = 0x8000001B
212
212
 
213
213
  if sys.platform == "win32":
214
214
  FILE_ATTRIBUTE_ARCHIVE: Final = 32
@@ -126,8 +126,8 @@ EXCEPTION: Final = 8
126
126
  READABLE: Final = 2
127
127
  WRITABLE: Final = 4
128
128
 
129
- TCL_VERSION: str
130
- TK_VERSION: str
129
+ TCL_VERSION: Final[str]
130
+ TK_VERSION: Final[str]
131
131
 
132
132
  @final
133
133
  class TkttType:
@@ -357,7 +357,17 @@ class Action(_AttributeHolder):
357
357
 
358
358
  if sys.version_info >= (3, 12):
359
359
  class BooleanOptionalAction(Action):
360
- if sys.version_info >= (3, 13):
360
+ if sys.version_info >= (3, 14):
361
+ def __init__(
362
+ self,
363
+ option_strings: Sequence[str],
364
+ dest: str,
365
+ default: bool | None = None,
366
+ required: bool = False,
367
+ help: str | None = None,
368
+ deprecated: bool = False,
369
+ ) -> None: ...
370
+ elif sys.version_info >= (3, 13):
361
371
  @overload
362
372
  def __init__(
363
373
  self,
@@ -1,6 +1,6 @@
1
1
  """
2
2
  This module defines an object type which can efficiently represent
3
- an array of basic values: characters, integers, floating point
3
+ an array of basic values: characters, integers, floating-point
4
4
  numbers. Arrays are sequence types and behave very much like lists,
5
5
  except that the type of objects stored in them is constrained.
6
6
  """
@@ -50,8 +50,8 @@ class array(MutableSequence[_T]):
50
50
  'L' unsigned integer 4
51
51
  'q' signed integer 8 (see note)
52
52
  'Q' unsigned integer 8 (see note)
53
- 'f' floating point 4
54
- 'd' floating point 8
53
+ 'f' floating-point 4
54
+ 'd' floating-point 8
55
55
 
56
56
  NOTE: The 'u' typecode corresponds to Python's unicode character. On
57
57
  narrow builds this is 2-bytes on wide builds this is 4-bytes.
@@ -10,27 +10,28 @@ class _ABC(type):
10
10
  if sys.version_info >= (3, 9):
11
11
  def __init__(cls, *args: Unused) -> None: ...
12
12
 
13
- @deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
14
- class Num(Constant, metaclass=_ABC):
15
- value: int | float | complex
13
+ if sys.version_info < (3, 14):
14
+ @deprecated("Replaced by ast.Constant; removed in Python 3.14")
15
+ class Num(Constant, metaclass=_ABC):
16
+ value: int | float | complex
16
17
 
17
- @deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
18
- class Str(Constant, metaclass=_ABC):
19
- value: str
20
- # Aliases for value, for backwards compatibility
21
- s: str
18
+ @deprecated("Replaced by ast.Constant; removed in Python 3.14")
19
+ class Str(Constant, metaclass=_ABC):
20
+ value: str
21
+ # Aliases for value, for backwards compatibility
22
+ s: str
22
23
 
23
- @deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
24
- class Bytes(Constant, metaclass=_ABC):
25
- value: bytes
26
- # Aliases for value, for backwards compatibility
27
- s: bytes
24
+ @deprecated("Replaced by ast.Constant; removed in Python 3.14")
25
+ class Bytes(Constant, metaclass=_ABC):
26
+ value: bytes
27
+ # Aliases for value, for backwards compatibility
28
+ s: bytes
28
29
 
29
- @deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
30
- class NameConstant(Constant, metaclass=_ABC): ...
30
+ @deprecated("Replaced by ast.Constant; removed in Python 3.14")
31
+ class NameConstant(Constant, metaclass=_ABC): ...
31
32
 
32
- @deprecated("Replaced by ast.Constant; removal scheduled for Python 3.14")
33
- class Ellipsis(Constant, metaclass=_ABC): ...
33
+ @deprecated("Replaced by ast.Constant; removed in Python 3.14")
34
+ class Ellipsis(Constant, metaclass=_ABC): ...
34
35
 
35
36
  if sys.version_info >= (3, 9):
36
37
  class slice(AST): ...
@@ -46,7 +46,8 @@ from collections.abc import Awaitable, Callable, Iterable, Iterator, MutableSet,
46
46
  from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
47
47
  from types import CellType, CodeType, TracebackType
48
48
 
49
- # mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping} are imported from collections.abc in builtins.pyi
49
+ # mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping}
50
+ # are imported from collections.abc in builtins.pyi
50
51
  from typing import ( # noqa: Y022
51
52
  IO,
52
53
  Any,
@@ -393,7 +394,7 @@ class int:
393
394
  int(x, base=10) -> integer
394
395
 
395
396
  Convert a number or string to an integer, or return 0 if no arguments
396
- are given. If x is a number, return x.__int__(). For floating point
397
+ are given. If x is a number, return x.__int__(). For floating-point
397
398
  numbers, this truncates towards zero.
398
399
 
399
400
  If x is not a number or if base is given, then x must be a string,
@@ -731,7 +732,7 @@ class int:
731
732
  ...
732
733
 
733
734
  class float:
734
- """Convert a string or number to a floating point number, if possible."""
735
+ """Convert a string or number to a floating-point number, if possible."""
735
736
  def __new__(cls, x: ConvertibleToFloat = ..., /) -> Self: ...
736
737
  def as_integer_ratio(self) -> tuple[int, int]:
737
738
  """
@@ -3481,7 +3482,8 @@ class dict(MutableMapping[_KT, _VT]):
3481
3482
  def items(self) -> dict_items[_KT, _VT]:
3482
3483
  """D.items() -> a set-like object providing a view on D's items"""
3483
3484
  ...
3484
- # Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections`
3485
+ # Signature of `dict.fromkeys` should be kept identical to
3486
+ # `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections`
3485
3487
  # TODO: the true signature of `dict.fromkeys` is not expressible in the current type system.
3486
3488
  # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
3487
3489
  @classmethod
@@ -6289,7 +6291,7 @@ class ValueError(Exception):
6289
6291
  """Inappropriate argument value (of correct type)."""
6290
6292
  ...
6291
6293
  class FloatingPointError(ArithmeticError):
6292
- """Floating point operation failed."""
6294
+ """Floating-point operation failed."""
6293
6295
  ...
6294
6296
  class OverflowError(ArithmeticError):
6295
6297
  """Result too large to be represented."""
@@ -1,10 +1,11 @@
1
1
  from collections.abc import Callable
2
2
  from typing import IO, Any, Final
3
+ from typing_extensions import LiteralString
3
4
 
4
5
  __all__ = ["Cmd"]
5
6
 
6
7
  PROMPT: Final = "(Cmd) "
7
- IDENTCHARS: str # Too big to be `Literal`
8
+ IDENTCHARS: Final[LiteralString] # Too big to be `Literal`
8
9
 
9
10
  class Cmd:
10
11
  prompt: str
@@ -622,7 +622,8 @@ class ChainMap(MutableMapping[_KT, _VT]):
622
622
  def pop(self, key: _KT, default: _T) -> _VT | _T: ...
623
623
  def copy(self) -> Self: ...
624
624
  __copy__ = copy
625
- # All arguments to `fromkeys` are passed to `dict.fromkeys` at runtime, so the signature should be kept in line with `dict.fromkeys`.
625
+ # All arguments to `fromkeys` are passed to `dict.fromkeys` at runtime,
626
+ # so the signature should be kept in line with `dict.fromkeys`.
626
627
  @classmethod
627
628
  @overload
628
629
  def fromkeys(cls, iterable: Iterable[_T]) -> ChainMap[_T, Any | None]: ...
@@ -55,6 +55,7 @@ class AbstractAsyncContextManager(Protocol[_T_co, _ExitT_co]):
55
55
  ) -> _ExitT_co: ...
56
56
 
57
57
  class ContextDecorator:
58
+ def _recreate_cm(self) -> Self: ...
58
59
  def __call__(self, func: _F) -> _F: ...
59
60
 
60
61
  class _GeneratorContextManager(AbstractContextManager[_T_co, bool | None], ContextDecorator):
@@ -80,6 +81,7 @@ if sys.version_info >= (3, 10):
80
81
  _AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
81
82
 
82
83
  class AsyncContextDecorator:
84
+ def _recreate_cm(self) -> Self: ...
83
85
  def __call__(self, func: _AF) -> _AF: ...
84
86
 
85
87
  class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co, bool | None], AsyncContextDecorator):
@@ -1,12 +1,13 @@
1
1
  import sys
2
+ from typing import Final
2
3
 
3
4
  if sys.platform != "win32":
4
5
  class _Method: ...
5
- METHOD_CRYPT: _Method
6
- METHOD_MD5: _Method
7
- METHOD_SHA256: _Method
8
- METHOD_SHA512: _Method
9
- METHOD_BLOWFISH: _Method
6
+ METHOD_CRYPT: Final[_Method]
7
+ METHOD_MD5: Final[_Method]
8
+ METHOD_SHA256: Final[_Method]
9
+ METHOD_SHA512: Final[_Method]
10
+ METHOD_BLOWFISH: Final[_Method]
10
11
  methods: list[_Method]
11
12
  def mksalt(method: _Method | None = None, *, rounds: int | None = None) -> str: ...
12
13
  def crypt(word: str, salt: str | _Method | None = None) -> str: ...
@@ -5,7 +5,7 @@ from _typeshed import DataclassInstance
5
5
  from builtins import type as Type # alias to avoid name clashes with fields named "type"
6
6
  from collections.abc import Callable, Iterable, Mapping
7
7
  from typing import Any, Generic, Literal, Protocol, TypeVar, overload
8
- from typing_extensions import TypeAlias, TypeIs
8
+ from typing_extensions import Never, TypeAlias, TypeIs
9
9
 
10
10
  if sys.version_info >= (3, 9):
11
11
  from types import GenericAlias
@@ -219,6 +219,10 @@ else:
219
219
  ) -> Any: ...
220
220
 
221
221
  def fields(class_or_instance: DataclassInstance | type[DataclassInstance]) -> tuple[Field[Any], ...]: ...
222
+
223
+ # HACK: `obj: Never` typing matches if object argument is using `Any` type.
224
+ @overload
225
+ def is_dataclass(obj: Never) -> TypeIs[DataclassInstance | type[DataclassInstance]]: ... # type: ignore[narrowed-type-not-subtype] # pyright: ignore[reportGeneralTypeIssues]
222
226
  @overload
223
227
  def is_dataclass(obj: type) -> TypeIs[type[DataclassInstance]]: ...
224
228
  @overload
@@ -446,7 +446,7 @@ class datetime(date):
446
446
  ...
447
447
 
448
448
  @classmethod
449
- @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.UTC)")
449
+ @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)")
450
450
  def utcfromtimestamp(cls, t: float, /) -> Self:
451
451
  """Construct a naive UTC datetime from a POSIX timestamp."""
452
452
  ...
@@ -462,7 +462,7 @@ class datetime(date):
462
462
  """
463
463
  ...
464
464
  @classmethod
465
- @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.UTC)")
465
+ @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)")
466
466
  def utcnow(cls) -> Self:
467
467
  """Return a new datetime representing UTC day and time."""
468
468
  ...
@@ -1,6 +1,26 @@
1
1
  from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
2
2
  from abc import abstractmethod
3
3
  from collections.abc import Callable, Iterable
4
+ from distutils.command.bdist import bdist
5
+ from distutils.command.bdist_dumb import bdist_dumb
6
+ from distutils.command.bdist_rpm import bdist_rpm
7
+ from distutils.command.build import build
8
+ from distutils.command.build_clib import build_clib
9
+ from distutils.command.build_ext import build_ext
10
+ from distutils.command.build_py import build_py
11
+ from distutils.command.build_scripts import build_scripts
12
+ from distutils.command.check import check
13
+ from distutils.command.clean import clean
14
+ from distutils.command.config import config
15
+ from distutils.command.install import install
16
+ from distutils.command.install_data import install_data
17
+ from distutils.command.install_egg_info import install_egg_info
18
+ from distutils.command.install_headers import install_headers
19
+ from distutils.command.install_lib import install_lib
20
+ from distutils.command.install_scripts import install_scripts
21
+ from distutils.command.register import register
22
+ from distutils.command.sdist import sdist
23
+ from distutils.command.upload import upload
4
24
  from distutils.dist import Distribution
5
25
  from distutils.file_util import _BytesPathT, _StrPathT
6
26
  from typing import Any, ClassVar, Literal, TypeVar, overload
@@ -28,8 +48,108 @@ class Command:
28
48
  def ensure_dirname(self, option: str) -> None: ...
29
49
  def get_command_name(self) -> str: ...
30
50
  def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ...
51
+ # NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst.
52
+ @overload
53
+ def get_finalized_command(self, command: Literal["bdist"], create: bool | Literal[0, 1] = 1) -> bdist: ...
54
+ @overload
55
+ def get_finalized_command(self, command: Literal["bdist_dumb"], create: bool | Literal[0, 1] = 1) -> bdist_dumb: ...
56
+ @overload
57
+ def get_finalized_command(self, command: Literal["bdist_rpm"], create: bool | Literal[0, 1] = 1) -> bdist_rpm: ...
58
+ @overload
59
+ def get_finalized_command(self, command: Literal["build"], create: bool | Literal[0, 1] = 1) -> build: ...
60
+ @overload
61
+ def get_finalized_command(self, command: Literal["build_clib"], create: bool | Literal[0, 1] = 1) -> build_clib: ...
62
+ @overload
63
+ def get_finalized_command(self, command: Literal["build_ext"], create: bool | Literal[0, 1] = 1) -> build_ext: ...
64
+ @overload
65
+ def get_finalized_command(self, command: Literal["build_py"], create: bool | Literal[0, 1] = 1) -> build_py: ...
66
+ @overload
67
+ def get_finalized_command(self, command: Literal["build_scripts"], create: bool | Literal[0, 1] = 1) -> build_scripts: ...
68
+ @overload
69
+ def get_finalized_command(self, command: Literal["check"], create: bool | Literal[0, 1] = 1) -> check: ...
70
+ @overload
71
+ def get_finalized_command(self, command: Literal["clean"], create: bool | Literal[0, 1] = 1) -> clean: ...
72
+ @overload
73
+ def get_finalized_command(self, command: Literal["config"], create: bool | Literal[0, 1] = 1) -> config: ...
74
+ @overload
75
+ def get_finalized_command(self, command: Literal["install"], create: bool | Literal[0, 1] = 1) -> install: ...
76
+ @overload
77
+ def get_finalized_command(self, command: Literal["install_data"], create: bool | Literal[0, 1] = 1) -> install_data: ...
78
+ @overload
79
+ def get_finalized_command(
80
+ self, command: Literal["install_egg_info"], create: bool | Literal[0, 1] = 1
81
+ ) -> install_egg_info: ...
82
+ @overload
83
+ def get_finalized_command(self, command: Literal["install_headers"], create: bool | Literal[0, 1] = 1) -> install_headers: ...
84
+ @overload
85
+ def get_finalized_command(self, command: Literal["install_lib"], create: bool | Literal[0, 1] = 1) -> install_lib: ...
86
+ @overload
87
+ def get_finalized_command(self, command: Literal["install_scripts"], create: bool | Literal[0, 1] = 1) -> install_scripts: ...
88
+ @overload
89
+ def get_finalized_command(self, command: Literal["register"], create: bool | Literal[0, 1] = 1) -> register: ...
90
+ @overload
91
+ def get_finalized_command(self, command: Literal["sdist"], create: bool | Literal[0, 1] = 1) -> sdist: ...
92
+ @overload
93
+ def get_finalized_command(self, command: Literal["upload"], create: bool | Literal[0, 1] = 1) -> upload: ...
94
+ @overload
31
95
  def get_finalized_command(self, command: str, create: bool | Literal[0, 1] = 1) -> Command: ...
32
96
  @overload
97
+ def reinitialize_command(self, command: Literal["bdist"], reinit_subcommands: bool | Literal[0, 1] = 0) -> bdist: ...
98
+ @overload
99
+ def reinitialize_command(
100
+ self, command: Literal["bdist_dumb"], reinit_subcommands: bool | Literal[0, 1] = 0
101
+ ) -> bdist_dumb: ...
102
+ @overload
103
+ def reinitialize_command(self, command: Literal["bdist_rpm"], reinit_subcommands: bool | Literal[0, 1] = 0) -> bdist_rpm: ...
104
+ @overload
105
+ def reinitialize_command(self, command: Literal["build"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build: ...
106
+ @overload
107
+ def reinitialize_command(
108
+ self, command: Literal["build_clib"], reinit_subcommands: bool | Literal[0, 1] = 0
109
+ ) -> build_clib: ...
110
+ @overload
111
+ def reinitialize_command(self, command: Literal["build_ext"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build_ext: ...
112
+ @overload
113
+ def reinitialize_command(self, command: Literal["build_py"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build_py: ...
114
+ @overload
115
+ def reinitialize_command(
116
+ self, command: Literal["build_scripts"], reinit_subcommands: bool | Literal[0, 1] = 0
117
+ ) -> build_scripts: ...
118
+ @overload
119
+ def reinitialize_command(self, command: Literal["check"], reinit_subcommands: bool | Literal[0, 1] = 0) -> check: ...
120
+ @overload
121
+ def reinitialize_command(self, command: Literal["clean"], reinit_subcommands: bool | Literal[0, 1] = 0) -> clean: ...
122
+ @overload
123
+ def reinitialize_command(self, command: Literal["config"], reinit_subcommands: bool | Literal[0, 1] = 0) -> config: ...
124
+ @overload
125
+ def reinitialize_command(self, command: Literal["install"], reinit_subcommands: bool | Literal[0, 1] = 0) -> install: ...
126
+ @overload
127
+ def reinitialize_command(
128
+ self, command: Literal["install_data"], reinit_subcommands: bool | Literal[0, 1] = 0
129
+ ) -> install_data: ...
130
+ @overload
131
+ def reinitialize_command(
132
+ self, command: Literal["install_egg_info"], reinit_subcommands: bool | Literal[0, 1] = 0
133
+ ) -> install_egg_info: ...
134
+ @overload
135
+ def reinitialize_command(
136
+ self, command: Literal["install_headers"], reinit_subcommands: bool | Literal[0, 1] = 0
137
+ ) -> install_headers: ...
138
+ @overload
139
+ def reinitialize_command(
140
+ self, command: Literal["install_lib"], reinit_subcommands: bool | Literal[0, 1] = 0
141
+ ) -> install_lib: ...
142
+ @overload
143
+ def reinitialize_command(
144
+ self, command: Literal["install_scripts"], reinit_subcommands: bool | Literal[0, 1] = 0
145
+ ) -> install_scripts: ...
146
+ @overload
147
+ def reinitialize_command(self, command: Literal["register"], reinit_subcommands: bool | Literal[0, 1] = 0) -> register: ...
148
+ @overload
149
+ def reinitialize_command(self, command: Literal["sdist"], reinit_subcommands: bool | Literal[0, 1] = 0) -> sdist: ...
150
+ @overload
151
+ def reinitialize_command(self, command: Literal["upload"], reinit_subcommands: bool | Literal[0, 1] = 0) -> upload: ...
152
+ @overload
33
153
  def reinitialize_command(self, command: str, reinit_subcommands: bool | Literal[0, 1] = 0) -> Command: ...
34
154
  @overload
35
155
  def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool | Literal[0, 1] = 0) -> _CommandT: ...
@@ -0,0 +1,48 @@
1
+ import sys
2
+
3
+ from . import (
4
+ bdist,
5
+ bdist_dumb,
6
+ bdist_rpm,
7
+ build,
8
+ build_clib,
9
+ build_ext,
10
+ build_py,
11
+ build_scripts,
12
+ check,
13
+ clean,
14
+ install,
15
+ install_data,
16
+ install_headers,
17
+ install_lib,
18
+ install_scripts,
19
+ register,
20
+ sdist,
21
+ upload,
22
+ )
23
+
24
+ __all__ = [
25
+ "build",
26
+ "build_py",
27
+ "build_ext",
28
+ "build_clib",
29
+ "build_scripts",
30
+ "clean",
31
+ "install",
32
+ "install_lib",
33
+ "install_headers",
34
+ "install_scripts",
35
+ "install_data",
36
+ "sdist",
37
+ "register",
38
+ "bdist",
39
+ "bdist_dumb",
40
+ "bdist_rpm",
41
+ "check",
42
+ "upload",
43
+ ]
44
+
45
+ if sys.version_info < (3, 10):
46
+ from . import bdist_wininst
47
+
48
+ __all__ += ["bdist_wininst"]
@@ -1,4 +1,4 @@
1
- from typing import Any, ClassVar, Literal
1
+ from typing import Any, ClassVar, Final, Literal
2
2
  from typing_extensions import TypeAlias
3
3
 
4
4
  from ..cmd import Command
@@ -22,7 +22,7 @@ class SilentReporter(_Reporter):
22
22
  ) -> None: ...
23
23
  def system_message(self, level, message, *children, **kwargs): ...
24
24
 
25
- HAS_DOCUTILS: bool
25
+ HAS_DOCUTILS: Final[bool]
26
26
 
27
27
  class check(Command):
28
28
  description: str
@@ -1,12 +1,12 @@
1
1
  from _typeshed import StrOrBytesPath
2
2
  from collections.abc import Sequence
3
3
  from re import Pattern
4
- from typing import Any, ClassVar, Literal
4
+ from typing import Any, ClassVar, Final, Literal
5
5
 
6
6
  from ..ccompiler import CCompiler
7
7
  from ..cmd import Command
8
8
 
9
- LANG_EXT: dict[str, str]
9
+ LANG_EXT: Final[dict[str, str]]
10
10
 
11
11
  class config(Command):
12
12
  description: str
@@ -1,11 +1,16 @@
1
+ import sys
1
2
  from collections.abc import Callable
2
- from typing import Any, ClassVar
3
+ from typing import Any, ClassVar, Final, Literal
3
4
 
4
5
  from ..cmd import Command
5
6
 
6
- HAS_USER_SITE: bool
7
- SCHEME_KEYS: tuple[str, ...]
8
- INSTALL_SCHEMES: dict[str, dict[Any, Any]]
7
+ HAS_USER_SITE: Final[bool]
8
+
9
+ SCHEME_KEYS: Final[tuple[Literal["purelib"], Literal["platlib"], Literal["headers"], Literal["scripts"], Literal["data"]]]
10
+ INSTALL_SCHEMES: Final[dict[str, dict[str, str]]]
11
+
12
+ if sys.version_info < (3, 10):
13
+ WINDOWS_SCHEME: Final[dict[str, str]]
9
14
 
10
15
  class install(Command):
11
16
  description: str
@@ -1,8 +1,8 @@
1
- from typing import Any, ClassVar
1
+ from typing import Any, ClassVar, Final
2
2
 
3
3
  from ..cmd import Command
4
4
 
5
- PYTHON_SOURCE_EXTENSION: str
5
+ PYTHON_SOURCE_EXTENSION: Final = ".py"
6
6
 
7
7
  class install_lib(Command):
8
8
  description: str
@@ -3,9 +3,9 @@ from collections.abc import Mapping
3
3
  from distutils.cmd import Command as Command
4
4
  from distutils.dist import Distribution as Distribution
5
5
  from distutils.extension import Extension as Extension
6
- from typing import Any, Literal
6
+ from typing import Any, Final, Literal
7
7
 
8
- USAGE: str
8
+ USAGE: Final[str]
9
9
 
10
10
  def gen_usage(script_name: StrOrBytesPath) -> str: ...
11
11
 
@@ -1,20 +1,20 @@
1
1
  from distutils.unixccompiler import UnixCCompiler
2
2
  from distutils.version import LooseVersion
3
3
  from re import Pattern
4
- from typing import Literal
4
+ from typing import Final, Literal
5
5
 
6
6
  def get_msvcr() -> list[str] | None: ...
7
7
 
8
8
  class CygwinCCompiler(UnixCCompiler): ...
9
9
  class Mingw32CCompiler(CygwinCCompiler): ...
10
10
 
11
- CONFIG_H_OK: str
12
- CONFIG_H_NOTOK: str
13
- CONFIG_H_UNCERTAIN: str
11
+ CONFIG_H_OK: Final = "ok"
12
+ CONFIG_H_NOTOK: Final = "not ok"
13
+ CONFIG_H_UNCERTAIN: Final = "uncertain"
14
14
 
15
15
  def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ...
16
16
 
17
- RE_VERSION: Pattern[bytes]
17
+ RE_VERSION: Final[Pattern[bytes]]
18
18
 
19
19
  def get_versions() -> tuple[LooseVersion | None, ...]: ...
20
20
  def is_cygwingcc() -> bool: ...
@@ -1 +1,3 @@
1
- DEBUG: bool | None
1
+ from typing import Final
2
+
3
+ DEBUG: Final[str | None]