basedpyright 1.13.2 → 1.13.3

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 (229) 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/VERSIONS +2 -0
  7. package/dist/typeshed-fallback/stdlib/_ast.pyi +42 -279
  8. package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
  9. package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
  10. package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +15 -5
  11. package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
  12. package/dist/typeshed-fallback/stdlib/_decimal.pyi +0 -18
  13. package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
  14. package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +180 -164
  15. package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
  16. package/dist/typeshed-fallback/stdlib/_interpqueues.pyi +16 -0
  17. package/dist/typeshed-fallback/stdlib/_interpreters.pyi +50 -0
  18. package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
  19. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
  20. package/dist/typeshed-fallback/stdlib/_msi.pyi +94 -92
  21. package/dist/typeshed-fallback/stdlib/_operator.pyi +0 -24
  22. package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
  23. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +6 -2
  24. package/dist/typeshed-fallback/stdlib/_weakrefset.pyi +7 -1
  25. package/dist/typeshed-fallback/stdlib/abc.pyi +12 -4
  26. package/dist/typeshed-fallback/stdlib/argparse.pyi +3 -1
  27. package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
  28. package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
  29. package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +35 -4
  30. package/dist/typeshed-fallback/stdlib/asyncio/futures.pyi +107 -15
  31. package/dist/typeshed-fallback/stdlib/asyncio/locks.pyi +9 -3
  32. package/dist/typeshed-fallback/stdlib/asyncio/queues.pyi +10 -2
  33. package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +23 -4
  34. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +107 -12
  35. package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +86 -86
  36. package/dist/typeshed-fallback/stdlib/asyncio/windows_utils.pyi +49 -49
  37. package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
  38. package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
  39. package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
  40. package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
  41. package/dist/typeshed-fallback/stdlib/builtins.pyi +0 -1
  42. package/dist/typeshed-fallback/stdlib/bz2.pyi +59 -6
  43. package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
  44. package/dist/typeshed-fallback/stdlib/codecs.pyi +18 -6
  45. package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +200 -56
  46. package/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi +33 -14
  47. package/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +7 -1
  48. package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +7 -1
  49. package/dist/typeshed-fallback/stdlib/contextvars.pyi +99 -16
  50. package/dist/typeshed-fallback/stdlib/csv.pyi +14 -2
  51. package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +7 -1
  52. package/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi +6 -2
  53. package/dist/typeshed-fallback/stdlib/curses/panel.pyi +16 -4
  54. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +7 -1
  55. package/dist/typeshed-fallback/stdlib/datetime.pyi +346 -104
  56. package/dist/typeshed-fallback/stdlib/dbm/gnu.pyi +52 -2
  57. package/dist/typeshed-fallback/stdlib/dbm/ndbm.pyi +26 -2
  58. package/dist/typeshed-fallback/stdlib/difflib.pyi +7 -1
  59. package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
  60. package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
  61. package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
  62. package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +173 -173
  63. package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +99 -99
  64. package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +25 -25
  65. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +21 -21
  66. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +45 -45
  67. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +52 -52
  68. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
  69. package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +33 -33
  70. package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +27 -27
  71. package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +50 -50
  72. package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +44 -44
  73. package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +24 -24
  74. package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +39 -39
  75. package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +17 -17
  76. package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
  77. package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +65 -65
  78. package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +19 -19
  79. package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +18 -18
  80. package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +16 -16
  81. package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +25 -25
  82. package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +18 -18
  83. package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +20 -20
  84. package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +44 -44
  85. package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +17 -17
  86. package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
  87. package/dist/typeshed-fallback/stdlib/distutils/core.pyi +57 -57
  88. package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
  89. package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +1 -1
  90. package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
  91. package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
  92. package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +149 -149
  93. package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
  94. package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
  95. package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
  96. package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
  97. package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
  98. package/dist/typeshed-fallback/stdlib/distutils/log.pyi +25 -25
  99. package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
  100. package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +6 -6
  101. package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
  102. package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
  103. package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
  104. package/dist/typeshed-fallback/stdlib/distutils/util.pyi +50 -50
  105. package/dist/typeshed-fallback/stdlib/distutils/version.pyi +38 -36
  106. package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
  107. package/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi +3 -1
  108. package/dist/typeshed-fallback/stdlib/email/charset.pyi +3 -1
  109. package/dist/typeshed-fallback/stdlib/email/header.pyi +3 -1
  110. package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +6 -1
  111. package/dist/typeshed-fallback/stdlib/enum.pyi +8 -1
  112. package/dist/typeshed-fallback/stdlib/filecmp.pyi +7 -1
  113. package/dist/typeshed-fallback/stdlib/fileinput.pyi +7 -1
  114. package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
  115. package/dist/typeshed-fallback/stdlib/fractions.pyi +6 -2
  116. package/dist/typeshed-fallback/stdlib/functools.pyi +65 -13
  117. package/dist/typeshed-fallback/stdlib/graphlib.pyi +7 -1
  118. package/dist/typeshed-fallback/stdlib/gzip.pyi +3 -1
  119. package/dist/typeshed-fallback/stdlib/hashlib.pyi +42 -14
  120. package/dist/typeshed-fallback/stdlib/heapq.pyi +3 -1
  121. package/dist/typeshed-fallback/stdlib/hmac.pyi +30 -2
  122. package/dist/typeshed-fallback/stdlib/http/cookies.pyi +7 -1
  123. package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
  124. package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +3 -1
  125. package/dist/typeshed-fallback/stdlib/importlib/machinery.pyi +3 -1
  126. package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +79 -15
  127. package/dist/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi +3 -1
  128. package/dist/typeshed-fallback/stdlib/importlib/resources/simple.pyi +3 -1
  129. package/dist/typeshed-fallback/stdlib/io.pyi +428 -44
  130. package/dist/typeshed-fallback/stdlib/ipaddress.pyi +153 -28
  131. package/dist/typeshed-fallback/stdlib/itertools.pyi +5 -1
  132. package/dist/typeshed-fallback/stdlib/json/encoder.pyi +14 -2
  133. package/dist/typeshed-fallback/stdlib/keyword.pyi +6 -2
  134. package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +12 -2
  135. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +17 -3
  136. package/dist/typeshed-fallback/stdlib/lzma.pyi +107 -9
  137. package/dist/typeshed-fallback/stdlib/mailbox.pyi +14 -2
  138. package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
  139. package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -160
  140. package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
  141. package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
  142. package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
  143. package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
  144. package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +9 -3
  145. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +12 -2
  146. package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +3 -1
  147. package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +10 -2
  148. package/dist/typeshed-fallback/stdlib/multiprocessing/pool.pyi +7 -1
  149. package/dist/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -30
  150. package/dist/typeshed-fallback/stdlib/multiprocessing/process.pyi +15 -4
  151. package/dist/typeshed-fallback/stdlib/multiprocessing/queues.pyi +14 -2
  152. package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +19 -5
  153. package/dist/typeshed-fallback/stdlib/nis.pyi +31 -4
  154. package/dist/typeshed-fallback/stdlib/numbers.pyi +26 -6
  155. package/dist/typeshed-fallback/stdlib/opcode.pyi +3 -1
  156. package/dist/typeshed-fallback/stdlib/optparse.pyi +3 -1
  157. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +1447 -217
  158. package/dist/typeshed-fallback/stdlib/pathlib.pyi +42 -11
  159. package/dist/typeshed-fallback/stdlib/pickle.pyi +200 -12
  160. package/dist/typeshed-fallback/stdlib/posixpath.pyi +6 -2
  161. package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +2 -0
  162. package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +2 -0
  163. package/dist/typeshed-fallback/stdlib/queue.pyi +57 -9
  164. package/dist/typeshed-fallback/stdlib/re.pyi +219 -57
  165. package/dist/typeshed-fallback/stdlib/sched.pyi +8 -1
  166. package/dist/typeshed-fallback/stdlib/signal.pyi +95 -19
  167. package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
  168. package/dist/typeshed-fallback/stdlib/socket.pyi +12 -2
  169. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +417 -83
  170. package/dist/typeshed-fallback/stdlib/ssl.pyi +133 -22
  171. package/dist/typeshed-fallback/stdlib/statistics.pyi +20 -5
  172. package/dist/typeshed-fallback/stdlib/struct.pyi +114 -13
  173. package/dist/typeshed-fallback/stdlib/subprocess.pyi +14 -2
  174. package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
  175. package/dist/typeshed-fallback/stdlib/symtable.pyi +30 -1
  176. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +7 -3
  177. package/dist/typeshed-fallback/stdlib/tarfile.pyi +6 -2
  178. package/dist/typeshed-fallback/stdlib/tempfile.pyi +17 -3
  179. package/dist/typeshed-fallback/stdlib/threading.pyi +68 -7
  180. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +3 -1
  181. package/dist/typeshed-fallback/stdlib/turtle.pyi +11 -3
  182. package/dist/typeshed-fallback/stdlib/types.pyi +306 -79
  183. package/dist/typeshed-fallback/stdlib/typing.pyi +310 -31
  184. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +42 -11
  185. package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +6 -1
  186. package/dist/typeshed-fallback/stdlib/unittest/case.pyi +7 -1
  187. package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +3 -1
  188. package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +51 -3
  189. package/dist/typeshed-fallback/stdlib/weakref.pyi +6 -2
  190. package/dist/typeshed-fallback/stdlib/winsound.pyi +44 -28
  191. package/dist/typeshed-fallback/stdlib/xml/dom/minicompat.pyi +6 -2
  192. package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +33 -11
  193. package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +30 -10
  194. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/errors.pyi +2 -0
  195. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/model.pyi +2 -0
  196. package/dist/typeshed-fallback/stdlib/xxlimited.pyi +19 -4
  197. package/dist/typeshed-fallback/stdlib/zipimport.pyi +31 -0
  198. package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
  199. package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +18 -6
  200. package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +2 -2
  201. package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +18 -1
  202. package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +5 -19
  203. package/dist/typeshed-fallback/stubs/docker/docker/api/daemon.pyi +2 -1
  204. package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +268 -6
  205. package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +3 -7
  206. package/dist/typeshed-fallback/stubs/docker/docker/types/daemon.pyi +10 -4
  207. package/dist/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi +47 -0
  208. package/dist/typeshed-fallback/stubs/gdb/gdb/__init__.pyi +1 -1
  209. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi +1 -1
  210. package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
  211. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +0 -2
  212. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +2 -1
  213. package/dist/typeshed-fallback/stubs/pygit2/METADATA.toml +1 -1
  214. package/dist/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi +2 -2
  215. package/dist/typeshed-fallback/stubs/python-crontab/METADATA.toml +1 -1
  216. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +1 -1
  217. package/dist/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi +23 -11
  218. package/dist/typeshed-fallback/stubs/reportlab/reportlab/pdfbase/pdfdoc.pyi +6 -0
  219. package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
  220. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi +8 -8
  221. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +11 -17
  222. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +11 -11
  223. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +1 -2
  224. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi +4 -12
  225. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +2 -4
  226. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi +5 -8
  227. package/dist/typeshed-fallback/stubs/str2bool/METADATA.toml +2 -0
  228. package/dist/typeshed-fallback/stubs/str2bool/str2bool/__init__.pyi +7 -0
  229. package/package.json +1 -1
@@ -98,14 +98,37 @@ else:
98
98
 
99
99
  _create_default_https_context: Callable[..., SSLContext]
100
100
 
101
- def RAND_bytes(n: int, /) -> bytes: ...
101
+ def RAND_bytes(n: int, /) -> bytes:
102
+ """Generate n cryptographically strong pseudo-random bytes."""
103
+ ...
102
104
 
103
105
  if sys.version_info < (3, 12):
104
- def RAND_pseudo_bytes(n: int, /) -> tuple[bytes, bool]: ...
105
-
106
- def RAND_status() -> bool: ...
106
+ def RAND_pseudo_bytes(n: int, /) -> tuple[bytes, bool]:
107
+ """
108
+ Generate n pseudo-random bytes.
109
+
110
+ Return a pair (bytes, is_cryptographic). is_cryptographic is True
111
+ if the bytes generated are cryptographically strong.
112
+ """
113
+ ...
114
+
115
+ def RAND_status() -> bool:
116
+ """
117
+ Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.
118
+
119
+ It is necessary to seed the PRNG with RAND_add() on some platforms before
120
+ using the ssl() function.
121
+ """
122
+ ...
107
123
  def RAND_egd(path: str) -> None: ...
108
- def RAND_add(string: str | ReadableBuffer, entropy: float, /) -> None: ...
124
+ def RAND_add(string: str | ReadableBuffer, entropy: float, /) -> None:
125
+ """
126
+ Mix string into the OpenSSL PRNG state.
127
+
128
+ entropy (a float) is a lower bound on the entropy contained in
129
+ string. See RFC 4086.
130
+ """
131
+ ...
109
132
 
110
133
  if sys.version_info < (3, 12):
111
134
  def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...
@@ -316,6 +339,10 @@ class _ASN1Object(_ASN1ObjectBase):
316
339
  def fromname(cls, name: str) -> Self: ...
317
340
 
318
341
  class Purpose(_ASN1Object, enum.Enum):
342
+ """
343
+ SSLContext purpose flags with X509v3 Extended Key Usage objects
344
+
345
+ """
319
346
  SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue]
320
347
  CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue]
321
348
 
@@ -325,7 +352,9 @@ class SSLSocket(socket.socket):
325
352
  server_hostname: str | None
326
353
  session: SSLSession | None
327
354
  @property
328
- def session_reused(self) -> bool | None: ...
355
+ def session_reused(self) -> bool | None:
356
+ """Was the client session reused during handshake"""
357
+ ...
329
358
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
330
359
  def connect(self, addr: socket._Address) -> None: ...
331
360
  def connect_ex(self, addr: socket._Address) -> int: ...
@@ -406,7 +435,17 @@ class SSLContext:
406
435
  else:
407
436
  def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
408
437
 
409
- def cert_store_stats(self) -> dict[str, int]: ...
438
+ def cert_store_stats(self) -> dict[str, int]:
439
+ """
440
+ Returns quantities of loaded X.509 certificates.
441
+
442
+ X.509 certificates with a CA extension and certificate revocation lists
443
+ inside the context's cert store.
444
+
445
+ NOTE: Certificates in a capath directory aren't loaded unless they have
446
+ been used at least once.
447
+ """
448
+ ...
410
449
  def load_cert_chain(
411
450
  self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None
412
451
  ) -> None: ...
@@ -418,11 +457,41 @@ class SSLContext:
418
457
  cadata: str | ReadableBuffer | None = None,
419
458
  ) -> None: ...
420
459
  @overload
421
- def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ...
460
+ def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]:
461
+ """
462
+ Returns a list of dicts with information of loaded CA certs.
463
+
464
+ If the optional argument is True, returns a DER-encoded copy of the CA
465
+ certificate.
466
+
467
+ NOTE: Certificates in a capath directory aren't loaded unless they have
468
+ been used at least once.
469
+ """
470
+ ...
422
471
  @overload
423
- def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ...
472
+ def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]:
473
+ """
474
+ Returns a list of dicts with information of loaded CA certs.
475
+
476
+ If the optional argument is True, returns a DER-encoded copy of the CA
477
+ certificate.
478
+
479
+ NOTE: Certificates in a capath directory aren't loaded unless they have
480
+ been used at least once.
481
+ """
482
+ ...
424
483
  @overload
425
- def get_ca_certs(self, binary_form: bool = False) -> Any: ...
484
+ def get_ca_certs(self, binary_form: bool = False) -> Any:
485
+ """
486
+ Returns a list of dicts with information of loaded CA certs.
487
+
488
+ If the optional argument is True, returns a DER-encoded copy of the CA
489
+ certificate.
490
+
491
+ NOTE: Certificates in a capath directory aren't loaded unless they have
492
+ been used at least once.
493
+ """
494
+ ...
426
495
  def get_ciphers(self) -> list[_Cipher]: ...
427
496
  def set_default_verify_paths(self) -> None: ...
428
497
  def set_ciphers(self, cipherlist: str, /) -> None: ...
@@ -453,12 +522,21 @@ class SSLContext:
453
522
  class SSLObject:
454
523
  context: SSLContext
455
524
  @property
456
- def server_side(self) -> bool: ...
525
+ def server_side(self) -> bool:
526
+ """Whether this is a server-side socket."""
527
+ ...
457
528
  @property
458
- def server_hostname(self) -> str | None: ...
529
+ def server_hostname(self) -> str | None:
530
+ """
531
+ The currently set server hostname (for SNI), or ``None`` if no
532
+ server hostname is set.
533
+ """
534
+ ...
459
535
  session: SSLSession | None
460
536
  @property
461
- def session_reused(self) -> bool: ...
537
+ def session_reused(self) -> bool:
538
+ """Was the client session reused during handshake"""
539
+ ...
462
540
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
463
541
  def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ...
464
542
  def write(self, data: ReadableBuffer) -> int: ...
@@ -487,23 +565,56 @@ class SSLObject:
487
565
  class MemoryBIO:
488
566
  pending: int
489
567
  eof: bool
490
- def read(self, size: int = -1, /) -> bytes: ...
491
- def write(self, b: ReadableBuffer, /) -> int: ...
492
- def write_eof(self) -> None: ...
568
+ def read(self, size: int = -1, /) -> bytes:
569
+ """
570
+ Read up to size bytes from the memory BIO.
571
+
572
+ If size is not specified, read the entire buffer.
573
+ If the return value is an empty bytes instance, this means either
574
+ EOF or that no data is available. Use the "eof" property to
575
+ distinguish between the two.
576
+ """
577
+ ...
578
+ def write(self, b: ReadableBuffer, /) -> int:
579
+ """
580
+ Writes the bytes b into the memory BIO.
581
+
582
+ Returns the number of bytes written.
583
+ """
584
+ ...
585
+ def write_eof(self) -> None:
586
+ """
587
+ Write an EOF marker to the memory BIO.
588
+
589
+ When all data has been read, the "eof" property will be True.
590
+ """
591
+ ...
493
592
 
494
593
  @final
495
594
  class SSLSession:
496
595
  @property
497
- def has_ticket(self) -> bool: ...
596
+ def has_ticket(self) -> bool:
597
+ """Does the session contain a ticket?"""
598
+ ...
498
599
  @property
499
- def id(self) -> bytes: ...
600
+ def id(self) -> bytes:
601
+ """Session id"""
602
+ ...
500
603
  @property
501
- def ticket_lifetime_hint(self) -> int: ...
604
+ def ticket_lifetime_hint(self) -> int:
605
+ """Ticket life time hint."""
606
+ ...
502
607
  @property
503
- def time(self) -> int: ...
608
+ def time(self) -> int:
609
+ """Session creation time (seconds since epoch)."""
610
+ ...
504
611
  @property
505
- def timeout(self) -> int: ...
506
- def __eq__(self, value: object, /) -> bool: ...
612
+ def timeout(self) -> int:
613
+ """Session timeout (delta in seconds)."""
614
+ ...
615
+ def __eq__(self, value: object, /) -> bool:
616
+ """Return self==value."""
617
+ ...
507
618
 
508
619
  class SSLErrorNumber(enum.IntEnum):
509
620
  SSL_ERROR_EOF = 8
@@ -78,15 +78,30 @@ def variance(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT
78
78
  class NormalDist:
79
79
  def __init__(self, mu: float = 0.0, sigma: float = 1.0) -> None: ...
80
80
  @property
81
- def mean(self) -> float: ...
81
+ def mean(self) -> float:
82
+ """Arithmetic mean of the normal distribution."""
83
+ ...
82
84
  @property
83
- def median(self) -> float: ...
85
+ def median(self) -> float:
86
+ """Return the median of the normal distribution"""
87
+ ...
84
88
  @property
85
- def mode(self) -> float: ...
89
+ def mode(self) -> float:
90
+ """
91
+ Return the mode of the normal distribution
92
+
93
+ The mode is the value x where which the probability density
94
+ function (pdf) takes its maximum value.
95
+ """
96
+ ...
86
97
  @property
87
- def stdev(self) -> float: ...
98
+ def stdev(self) -> float:
99
+ """Standard deviation of the normal distribution."""
100
+ ...
88
101
  @property
89
- def variance(self) -> float: ...
102
+ def variance(self) -> float:
103
+ """Square of the standard deviation."""
104
+ ...
90
105
  @classmethod
91
106
  def from_samples(cls, data: Iterable[SupportsFloat]) -> Self: ...
92
107
  def samples(self, n: int, *, seed: Any | None = None) -> list[float]: ...
@@ -6,21 +6,122 @@ __all__ = ["calcsize", "pack", "pack_into", "unpack", "unpack_from", "iter_unpac
6
6
 
7
7
  class error(Exception): ...
8
8
 
9
- def pack(fmt: str | bytes, /, *v: Any) -> bytes: ...
10
- def pack_into(fmt: str | bytes, buffer: WriteableBuffer, offset: int, /, *v: Any) -> None: ...
11
- def unpack(format: str | bytes, buffer: ReadableBuffer, /) -> tuple[Any, ...]: ...
12
- def unpack_from(format: str | bytes, /, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ...
13
- def iter_unpack(format: str | bytes, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]: ...
14
- def calcsize(format: str | bytes, /) -> int: ...
9
+ def pack(fmt: str | bytes, /, *v: Any) -> bytes:
10
+ """
11
+ pack(format, v1, v2, ...) -> bytes
12
+
13
+ Return a bytes object containing the values v1, v2, ... packed according
14
+ to the format string. See help(struct) for more on format strings.
15
+ """
16
+ ...
17
+ def pack_into(fmt: str | bytes, buffer: WriteableBuffer, offset: int, /, *v: Any) -> None:
18
+ """
19
+ pack_into(format, buffer, offset, v1, v2, ...)
20
+
21
+ Pack the values v1, v2, ... according to the format string and write
22
+ the packed bytes into the writable buffer buf starting at offset. Note
23
+ that the offset is a required argument. See help(struct) for more
24
+ on format strings.
25
+ """
26
+ ...
27
+ def unpack(format: str | bytes, buffer: ReadableBuffer, /) -> tuple[Any, ...]:
28
+ """
29
+ Return a tuple containing values unpacked according to the format string.
30
+
31
+ The buffer's size in bytes must be calcsize(format).
32
+
33
+ See help(struct) for more on format strings.
34
+ """
35
+ ...
36
+ def unpack_from(format: str | bytes, /, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]:
37
+ """
38
+ Return a tuple containing values unpacked according to the format string.
39
+
40
+ The buffer's size, minus offset, must be at least calcsize(format).
41
+
42
+ See help(struct) for more on format strings.
43
+ """
44
+ ...
45
+ def iter_unpack(format: str | bytes, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]:
46
+ """
47
+ Return an iterator yielding tuples unpacked from the given bytes.
48
+
49
+ The bytes are unpacked according to the format string, like
50
+ a repeated invocation of unpack_from().
51
+
52
+ Requires that the bytes length be a multiple of the format struct size.
53
+ """
54
+ ...
55
+ def calcsize(format: str | bytes, /) -> int:
56
+ """Return size in bytes of the struct described by the format string."""
57
+ ...
15
58
 
16
59
  class Struct:
60
+ """
61
+ Create a compiled struct object.
62
+
63
+ Return a new Struct object which writes and reads binary data according to
64
+ the format string.
65
+
66
+ See help(struct) for more on format strings.
67
+ """
17
68
  @property
18
- def format(self) -> str: ...
69
+ def format(self) -> str:
70
+ """struct format string"""
71
+ ...
19
72
  @property
20
- def size(self) -> int: ...
73
+ def size(self) -> int:
74
+ """struct size in bytes"""
75
+ ...
21
76
  def __init__(self, format: str | bytes) -> None: ...
22
- def pack(self, *v: Any) -> bytes: ...
23
- def pack_into(self, buffer: WriteableBuffer, offset: int, *v: Any) -> None: ...
24
- def unpack(self, buffer: ReadableBuffer, /) -> tuple[Any, ...]: ...
25
- def unpack_from(self, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ...
26
- def iter_unpack(self, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]: ...
77
+ def pack(self, *v: Any) -> bytes:
78
+ """
79
+ S.pack(v1, v2, ...) -> bytes
80
+
81
+ Return a bytes object containing values v1, v2, ... packed according
82
+ to the format string S.format. See help(struct) for more on format
83
+ strings.
84
+ """
85
+ ...
86
+ def pack_into(self, buffer: WriteableBuffer, offset: int, *v: Any) -> None:
87
+ """
88
+ S.pack_into(buffer, offset, v1, v2, ...)
89
+
90
+ Pack the values v1, v2, ... according to the format string S.format
91
+ and write the packed bytes into the writable buffer buf starting at
92
+ offset. Note that the offset is a required argument. See
93
+ help(struct) for more on format strings.
94
+ """
95
+ ...
96
+ def unpack(self, buffer: ReadableBuffer, /) -> tuple[Any, ...]:
97
+ """
98
+ Return a tuple containing unpacked values.
99
+
100
+ Unpack according to the format string Struct.format. The buffer's size
101
+ in bytes must be Struct.size.
102
+
103
+ See help(struct) for more on format strings.
104
+ """
105
+ ...
106
+ def unpack_from(self, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]:
107
+ """
108
+ Return a tuple containing unpacked values.
109
+
110
+ Values are unpacked according to the format string Struct.format.
111
+
112
+ The buffer's size in bytes, starting at position offset, must be
113
+ at least Struct.size.
114
+
115
+ See help(struct) for more on format strings.
116
+ """
117
+ ...
118
+ def iter_unpack(self, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]:
119
+ """
120
+ Return an iterator yielding tuples.
121
+
122
+ Tuples are unpacked from the given bytes source, like a repeated
123
+ invocation of unpack_from().
124
+
125
+ Requires that the bytes length be a multiple of the struct size.
126
+ """
127
+ ...
@@ -88,7 +88,13 @@ class CompletedProcess(Generic[_T]):
88
88
  def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ...
89
89
  def check_returncode(self) -> None: ...
90
90
  if sys.version_info >= (3, 9):
91
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
91
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
92
+ """
93
+ Represent a PEP 585 generic type
94
+
95
+ E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
96
+ """
97
+ ...
92
98
 
93
99
  if sys.version_info >= (3, 11):
94
100
  # 3.11 adds "process_group" argument
@@ -2568,7 +2574,13 @@ class Popen(Generic[AnyStr]):
2568
2574
  ) -> None: ...
2569
2575
  def __del__(self) -> None: ...
2570
2576
  if sys.version_info >= (3, 9):
2571
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
2577
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
2578
+ """
2579
+ Represent a PEP 585 generic type
2580
+
2581
+ E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
2582
+ """
2583
+ ...
2572
2584
 
2573
2585
  # The result really is always a str.
2574
2586
  if sys.version_info >= (3, 11):
@@ -1,93 +1,93 @@
1
- single_input: int
2
- file_input: int
3
- eval_input: int
4
- decorator: int
5
- decorators: int
6
- decorated: int
7
- async_funcdef: int
8
- funcdef: int
9
- parameters: int
10
- typedargslist: int
11
- tfpdef: int
12
- varargslist: int
13
- vfpdef: int
14
- stmt: int
15
- simple_stmt: int
16
- small_stmt: int
17
- expr_stmt: int
18
- annassign: int
19
- testlist_star_expr: int
20
- augassign: int
21
- del_stmt: int
22
- pass_stmt: int
23
- flow_stmt: int
24
- break_stmt: int
25
- continue_stmt: int
26
- return_stmt: int
27
- yield_stmt: int
28
- raise_stmt: int
29
- import_stmt: int
30
- import_name: int
31
- import_from: int
32
- import_as_name: int
33
- dotted_as_name: int
34
- import_as_names: int
35
- dotted_as_names: int
36
- dotted_name: int
37
- global_stmt: int
38
- nonlocal_stmt: int
39
- assert_stmt: int
40
- compound_stmt: int
41
- async_stmt: int
42
- if_stmt: int
43
- while_stmt: int
44
- for_stmt: int
45
- try_stmt: int
46
- with_stmt: int
47
- with_item: int
48
- except_clause: int
49
- suite: int
50
- test: int
51
- test_nocond: int
52
- lambdef: int
53
- lambdef_nocond: int
54
- or_test: int
55
- and_test: int
56
- not_test: int
57
- comparison: int
58
- comp_op: int
59
- star_expr: int
60
- expr: int
61
- xor_expr: int
62
- and_expr: int
63
- shift_expr: int
64
- arith_expr: int
65
- term: int
66
- factor: int
67
- power: int
68
- atom_expr: int
69
- atom: int
70
- testlist_comp: int
71
- trailer: int
72
- subscriptlist: int
73
- subscript: int
74
- sliceop: int
75
- exprlist: int
76
- testlist: int
77
- dictorsetmaker: int
78
- classdef: int
79
- arglist: int
80
- argument: int
81
- comp_iter: int
82
- comp_for: int
83
- comp_if: int
84
- encoding_decl: int
85
- yield_expr: int
86
- yield_arg: int
87
- sync_comp_for: int
88
- func_body_suite: int
89
- func_type: int
90
- func_type_input: int
91
- namedexpr_test: int
92
- typelist: int
93
- sym_name: dict[int, str]
1
+ single_input: int
2
+ file_input: int
3
+ eval_input: int
4
+ decorator: int
5
+ decorators: int
6
+ decorated: int
7
+ async_funcdef: int
8
+ funcdef: int
9
+ parameters: int
10
+ typedargslist: int
11
+ tfpdef: int
12
+ varargslist: int
13
+ vfpdef: int
14
+ stmt: int
15
+ simple_stmt: int
16
+ small_stmt: int
17
+ expr_stmt: int
18
+ annassign: int
19
+ testlist_star_expr: int
20
+ augassign: int
21
+ del_stmt: int
22
+ pass_stmt: int
23
+ flow_stmt: int
24
+ break_stmt: int
25
+ continue_stmt: int
26
+ return_stmt: int
27
+ yield_stmt: int
28
+ raise_stmt: int
29
+ import_stmt: int
30
+ import_name: int
31
+ import_from: int
32
+ import_as_name: int
33
+ dotted_as_name: int
34
+ import_as_names: int
35
+ dotted_as_names: int
36
+ dotted_name: int
37
+ global_stmt: int
38
+ nonlocal_stmt: int
39
+ assert_stmt: int
40
+ compound_stmt: int
41
+ async_stmt: int
42
+ if_stmt: int
43
+ while_stmt: int
44
+ for_stmt: int
45
+ try_stmt: int
46
+ with_stmt: int
47
+ with_item: int
48
+ except_clause: int
49
+ suite: int
50
+ test: int
51
+ test_nocond: int
52
+ lambdef: int
53
+ lambdef_nocond: int
54
+ or_test: int
55
+ and_test: int
56
+ not_test: int
57
+ comparison: int
58
+ comp_op: int
59
+ star_expr: int
60
+ expr: int
61
+ xor_expr: int
62
+ and_expr: int
63
+ shift_expr: int
64
+ arith_expr: int
65
+ term: int
66
+ factor: int
67
+ power: int
68
+ atom_expr: int
69
+ atom: int
70
+ testlist_comp: int
71
+ trailer: int
72
+ subscriptlist: int
73
+ subscript: int
74
+ sliceop: int
75
+ exprlist: int
76
+ testlist: int
77
+ dictorsetmaker: int
78
+ classdef: int
79
+ arglist: int
80
+ argument: int
81
+ comp_iter: int
82
+ comp_for: int
83
+ comp_if: int
84
+ encoding_decl: int
85
+ yield_expr: int
86
+ yield_arg: int
87
+ sync_comp_for: int
88
+ func_body_suite: int
89
+ func_type: int
90
+ func_type_input: int
91
+ namedexpr_test: int
92
+ typelist: int
93
+ sym_name: dict[int, str]
@@ -5,11 +5,30 @@ from typing import Any
5
5
 
6
6
  __all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]
7
7
 
8
+ if sys.version_info >= (3, 13):
9
+ __all__ += ["SymbolTableType"]
10
+
8
11
  def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...
9
12
 
13
+ if sys.version_info >= (3, 13):
14
+ from enum import StrEnum
15
+
16
+ class SymbolTableType(StrEnum):
17
+ MODULE = "module"
18
+ FUNCTION = "function"
19
+ CLASS = "class"
20
+ ANNOTATION = "annotation"
21
+ TYPE_ALIAS = "type alias"
22
+ TYPE_PARAMETERS = "type parameters"
23
+ TYPE_VARIABLE = "type variable"
24
+
10
25
  class SymbolTable:
11
26
  def __init__(self, raw_table: Any, filename: str) -> None: ...
12
- def get_type(self) -> str: ...
27
+ if sys.version_info >= (3, 13):
28
+ def get_type(self) -> SymbolTableType: ...
29
+ else:
30
+ def get_type(self) -> str: ...
31
+
13
32
  def get_id(self) -> int: ...
14
33
  def get_name(self) -> str: ...
15
34
  def get_lineno(self) -> int: ...
@@ -42,13 +61,23 @@ class Symbol:
42
61
  def get_name(self) -> str: ...
43
62
  def is_referenced(self) -> bool: ...
44
63
  def is_parameter(self) -> bool: ...
64
+ if sys.version_info >= (3, 14):
65
+ def is_type_parameter(self) -> bool: ...
66
+
45
67
  def is_global(self) -> bool: ...
46
68
  def is_declared_global(self) -> bool: ...
47
69
  def is_local(self) -> bool: ...
48
70
  def is_annotated(self) -> bool: ...
49
71
  def is_free(self) -> bool: ...
72
+ if sys.version_info >= (3, 14):
73
+ def is_free_class(self) -> bool: ...
74
+
50
75
  def is_imported(self) -> bool: ...
51
76
  def is_assigned(self) -> bool: ...
77
+ if sys.version_info >= (3, 14):
78
+ def is_comp_iter(self) -> bool: ...
79
+ def is_comp_cell(self) -> bool: ...
80
+
52
81
  def is_namespace(self) -> bool: ...
53
82
  def get_namespaces(self) -> Sequence[SymbolTable]: ...
54
83
  def get_namespace(self) -> SymbolTable: ...
@@ -681,9 +681,13 @@ def get_int_max_str_digits() -> int:
681
681
  ...
682
682
 
683
683
  if sys.version_info >= (3, 12):
684
- def getunicodeinternedsize() -> int:
685
- """Return the number of elements of the unicode interned dictionary"""
686
- ...
684
+ if sys.version_info >= (3, 13):
685
+ def getunicodeinternedsize(*, _only_immortal: bool = False) -> int: ...
686
+ else:
687
+ def getunicodeinternedsize() -> int:
688
+ """Return the number of elements of the unicode interned dictionary"""
689
+ ...
690
+
687
691
  def deactivate_stack_trampoline() -> None:
688
692
  """
689
693
  Deactivate the current stack profiler trampoline backend.