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
@@ -1,164 +1,180 @@
1
- import sys
2
- from _thread import _excepthook, _ExceptHookArgs
3
- from _typeshed import ProfileFunction, TraceFunction
4
- from collections.abc import Callable, Iterable, Mapping
5
- from types import TracebackType
6
- from typing import Any, TypeVar
7
-
8
- _T = TypeVar("_T")
9
-
10
- __all__ = [
11
- "get_ident",
12
- "active_count",
13
- "Condition",
14
- "current_thread",
15
- "enumerate",
16
- "main_thread",
17
- "TIMEOUT_MAX",
18
- "Event",
19
- "Lock",
20
- "RLock",
21
- "Semaphore",
22
- "BoundedSemaphore",
23
- "Thread",
24
- "Barrier",
25
- "BrokenBarrierError",
26
- "Timer",
27
- "ThreadError",
28
- "setprofile",
29
- "settrace",
30
- "local",
31
- "stack_size",
32
- "ExceptHookArgs",
33
- "excepthook",
34
- ]
35
-
36
- def active_count() -> int: ...
37
- def current_thread() -> Thread: ...
38
- def currentThread() -> Thread: ...
39
- def get_ident() -> int: ...
40
- def enumerate() -> list[Thread]: ...
41
- def main_thread() -> Thread: ...
42
- def settrace(func: TraceFunction) -> None: ...
43
- def setprofile(func: ProfileFunction | None) -> None: ...
44
- def stack_size(size: int | None = None) -> int: ...
45
-
46
- TIMEOUT_MAX: float
47
-
48
- class ThreadError(Exception): ...
49
-
50
- class local:
51
- def __getattribute__(self, name: str) -> Any: ...
52
- def __setattr__(self, name: str, value: Any) -> None: ...
53
- def __delattr__(self, name: str) -> None: ...
54
-
55
- class Thread:
56
- name: str
57
- daemon: bool
58
- @property
59
- def ident(self) -> int | None: ...
60
- def __init__(
61
- self,
62
- group: None = None,
63
- target: Callable[..., object] | None = None,
64
- name: str | None = None,
65
- args: Iterable[Any] = (),
66
- kwargs: Mapping[str, Any] | None = None,
67
- *,
68
- daemon: bool | None = None,
69
- ) -> None: ...
70
- def start(self) -> None: ...
71
- def run(self) -> None: ...
72
- def join(self, timeout: float | None = None) -> None: ...
73
- def getName(self) -> str: ...
74
- def setName(self, name: str) -> None: ...
75
- @property
76
- def native_id(self) -> int | None: ... # only available on some platforms
77
- def is_alive(self) -> bool: ...
78
- if sys.version_info < (3, 9):
79
- def isAlive(self) -> bool: ...
80
-
81
- def isDaemon(self) -> bool: ...
82
- def setDaemon(self, daemonic: bool) -> None: ...
83
-
84
- class _DummyThread(Thread): ...
85
-
86
- class Lock:
87
- def __enter__(self) -> bool: ...
88
- def __exit__(
89
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
90
- ) -> bool | None: ...
91
- def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
92
- def release(self) -> None: ...
93
- def locked(self) -> bool: ...
94
-
95
- class _RLock:
96
- def __enter__(self) -> bool: ...
97
- def __exit__(
98
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
99
- ) -> bool | None: ...
100
- def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
101
- def release(self) -> None: ...
102
-
103
- RLock = _RLock
104
-
105
- class Condition:
106
- def __init__(self, lock: Lock | _RLock | None = None) -> None: ...
107
- def __enter__(self) -> bool: ...
108
- def __exit__(
109
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
110
- ) -> bool | None: ...
111
- def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
112
- def release(self) -> None: ...
113
- def wait(self, timeout: float | None = None) -> bool: ...
114
- def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
115
- def notify(self, n: int = 1) -> None: ...
116
- def notify_all(self) -> None: ...
117
- def notifyAll(self) -> None: ...
118
-
119
- class Semaphore:
120
- def __init__(self, value: int = 1) -> None: ...
121
- def __exit__(
122
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
123
- ) -> bool | None: ...
124
- def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ...
125
- def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ...
126
- if sys.version_info >= (3, 9):
127
- def release(self, n: int = ...) -> None: ...
128
- else:
129
- def release(self) -> None: ...
130
-
131
- class BoundedSemaphore(Semaphore): ...
132
-
133
- class Event:
134
- def is_set(self) -> bool: ...
135
- def set(self) -> None: ...
136
- def clear(self) -> None: ...
137
- def wait(self, timeout: float | None = None) -> bool: ...
138
-
139
- excepthook = _excepthook
140
- ExceptHookArgs = _ExceptHookArgs
141
-
142
- class Timer(Thread):
143
- def __init__(
144
- self,
145
- interval: float,
146
- function: Callable[..., object],
147
- args: Iterable[Any] | None = None,
148
- kwargs: Mapping[str, Any] | None = None,
149
- ) -> None: ...
150
- def cancel(self) -> None: ...
151
-
152
- class Barrier:
153
- @property
154
- def parties(self) -> int: ...
155
- @property
156
- def n_waiting(self) -> int: ...
157
- @property
158
- def broken(self) -> bool: ...
159
- def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ...
160
- def wait(self, timeout: float | None = None) -> int: ...
161
- def reset(self) -> None: ...
162
- def abort(self) -> None: ...
163
-
164
- class BrokenBarrierError(RuntimeError): ...
1
+ import sys
2
+ from _thread import _excepthook, _ExceptHookArgs
3
+ from _typeshed import ProfileFunction, TraceFunction
4
+ from collections.abc import Callable, Iterable, Mapping
5
+ from types import TracebackType
6
+ from typing import Any, TypeVar
7
+
8
+ _T = TypeVar("_T")
9
+
10
+ __all__ = [
11
+ "get_ident",
12
+ "active_count",
13
+ "Condition",
14
+ "current_thread",
15
+ "enumerate",
16
+ "main_thread",
17
+ "TIMEOUT_MAX",
18
+ "Event",
19
+ "Lock",
20
+ "RLock",
21
+ "Semaphore",
22
+ "BoundedSemaphore",
23
+ "Thread",
24
+ "Barrier",
25
+ "BrokenBarrierError",
26
+ "Timer",
27
+ "ThreadError",
28
+ "setprofile",
29
+ "settrace",
30
+ "local",
31
+ "stack_size",
32
+ "ExceptHookArgs",
33
+ "excepthook",
34
+ ]
35
+
36
+ def active_count() -> int: ...
37
+ def current_thread() -> Thread: ...
38
+ def currentThread() -> Thread: ...
39
+ def get_ident() -> int: ...
40
+ def enumerate() -> list[Thread]: ...
41
+ def main_thread() -> Thread: ...
42
+ def settrace(func: TraceFunction) -> None: ...
43
+ def setprofile(func: ProfileFunction | None) -> None: ...
44
+ def stack_size(size: int | None = None) -> int: ...
45
+
46
+ TIMEOUT_MAX: float
47
+
48
+ class ThreadError(Exception):
49
+ """Unspecified run-time error."""
50
+ ...
51
+
52
+ class local:
53
+ def __getattribute__(self, name: str) -> Any: ...
54
+ def __setattr__(self, name: str, value: Any) -> None: ...
55
+ def __delattr__(self, name: str) -> None: ...
56
+
57
+ class Thread:
58
+ name: str
59
+ daemon: bool
60
+ @property
61
+ def ident(self) -> int | None:
62
+ """
63
+ Thread identifier of this thread or None if it has not been started.
64
+
65
+ This is a nonzero integer. See the get_ident() function. Thread
66
+ identifiers may be recycled when a thread exits and another thread is
67
+ created. The identifier is available even after the thread has exited.
68
+ """
69
+ ...
70
+ def __init__(
71
+ self,
72
+ group: None = None,
73
+ target: Callable[..., object] | None = None,
74
+ name: str | None = None,
75
+ args: Iterable[Any] = (),
76
+ kwargs: Mapping[str, Any] | None = None,
77
+ *,
78
+ daemon: bool | None = None,
79
+ ) -> None: ...
80
+ def start(self) -> None: ...
81
+ def run(self) -> None: ...
82
+ def join(self, timeout: float | None = None) -> None: ...
83
+ def getName(self) -> str: ...
84
+ def setName(self, name: str) -> None: ...
85
+ @property
86
+ def native_id(self) -> int | None: ... # only available on some platforms
87
+ def is_alive(self) -> bool: ...
88
+ if sys.version_info < (3, 9):
89
+ def isAlive(self) -> bool: ...
90
+
91
+ def isDaemon(self) -> bool: ...
92
+ def setDaemon(self, daemonic: bool) -> None: ...
93
+
94
+ class _DummyThread(Thread): ...
95
+
96
+ class Lock:
97
+ def __enter__(self) -> bool: ...
98
+ def __exit__(
99
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
100
+ ) -> bool | None: ...
101
+ def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
102
+ def release(self) -> None: ...
103
+ def locked(self) -> bool: ...
104
+
105
+ class _RLock:
106
+ def __enter__(self) -> bool: ...
107
+ def __exit__(
108
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
109
+ ) -> bool | None: ...
110
+ def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
111
+ def release(self) -> None: ...
112
+
113
+ RLock = _RLock
114
+
115
+ class Condition:
116
+ def __init__(self, lock: Lock | _RLock | None = None) -> None: ...
117
+ def __enter__(self) -> bool: ...
118
+ def __exit__(
119
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
120
+ ) -> bool | None: ...
121
+ def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
122
+ def release(self) -> None: ...
123
+ def wait(self, timeout: float | None = None) -> bool: ...
124
+ def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
125
+ def notify(self, n: int = 1) -> None: ...
126
+ def notify_all(self) -> None: ...
127
+ def notifyAll(self) -> None: ...
128
+
129
+ class Semaphore:
130
+ def __init__(self, value: int = 1) -> None: ...
131
+ def __exit__(
132
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
133
+ ) -> bool | None: ...
134
+ def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ...
135
+ def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ...
136
+ if sys.version_info >= (3, 9):
137
+ def release(self, n: int = ...) -> None: ...
138
+ else:
139
+ def release(self) -> None: ...
140
+
141
+ class BoundedSemaphore(Semaphore): ...
142
+
143
+ class Event:
144
+ def is_set(self) -> bool: ...
145
+ def set(self) -> None: ...
146
+ def clear(self) -> None: ...
147
+ def wait(self, timeout: float | None = None) -> bool: ...
148
+
149
+ excepthook = _excepthook
150
+ ExceptHookArgs = _ExceptHookArgs
151
+
152
+ class Timer(Thread):
153
+ def __init__(
154
+ self,
155
+ interval: float,
156
+ function: Callable[..., object],
157
+ args: Iterable[Any] | None = None,
158
+ kwargs: Mapping[str, Any] | None = None,
159
+ ) -> None: ...
160
+ def cancel(self) -> None: ...
161
+
162
+ class Barrier:
163
+ @property
164
+ def parties(self) -> int:
165
+ """Return the number of threads required to trip the barrier."""
166
+ ...
167
+ @property
168
+ def n_waiting(self) -> int:
169
+ """Return the number of threads currently waiting at the barrier."""
170
+ ...
171
+ @property
172
+ def broken(self) -> bool:
173
+ """Return True if the barrier is in a broken state."""
174
+ ...
175
+ def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ...
176
+ def wait(self, timeout: float | None = None) -> int: ...
177
+ def reset(self) -> None: ...
178
+ def abort(self) -> None: ...
179
+
180
+ class BrokenBarrierError(RuntimeError): ...
@@ -1,67 +1,67 @@
1
- """
2
- Heap queue algorithm (a.k.a. priority queue).
3
-
4
- Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
5
- all k, counting elements from 0. For the sake of comparison,
6
- non-existing elements are considered to be infinite. The interesting
7
- property of a heap is that a[0] is always its smallest element.
8
-
9
- Usage:
10
-
11
- heap = [] # creates an empty heap
12
- heappush(heap, item) # pushes a new item on the heap
13
- item = heappop(heap) # pops the smallest item from the heap
14
- item = heap[0] # smallest item on the heap without popping it
15
- heapify(x) # transforms list into a heap, in-place, in linear time
16
- item = heapreplace(heap, item) # pops and returns smallest item, and adds
17
- # new item; the heap size is unchanged
18
-
19
- Our API differs from textbook heap algorithms as follows:
20
-
21
- - We use 0-based indexing. This makes the relationship between the
22
- index for a node and the indexes for its children slightly less
23
- obvious, but is more suitable since Python uses 0-based indexing.
24
-
25
- - Our heappop() method returns the smallest item, not the largest.
26
-
27
- These two make it possible to view the heap as a regular Python list
28
- without surprises: heap[0] is the smallest item, and heap.sort()
29
- maintains the heap invariant!
30
- """
31
-
32
- from typing import Any, Final, TypeVar
33
-
34
- _T = TypeVar("_T")
35
-
36
- __about__: Final[str]
37
-
38
- def heapify(heap: list[Any], /) -> None:
39
- """Transform list into a heap, in-place, in O(len(heap)) time."""
40
- ...
41
- def heappop(heap: list[_T], /) -> _T:
42
- """Pop the smallest item off the heap, maintaining the heap invariant."""
43
- ...
44
- def heappush(heap: list[_T], item: _T, /) -> None:
45
- """Push item onto heap, maintaining the heap invariant."""
46
- ...
47
- def heappushpop(heap: list[_T], item: _T, /) -> _T:
48
- """
49
- Push item on the heap, then pop and return the smallest item from the heap.
50
-
51
- The combined action runs more efficiently than heappush() followed by
52
- a separate call to heappop().
53
- """
54
- ...
55
- def heapreplace(heap: list[_T], item: _T, /) -> _T:
56
- """
57
- Pop and return the current smallest value, and add the new item.
58
-
59
- This is more efficient than heappop() followed by heappush(), and can be
60
- more appropriate when using a fixed-size heap. Note that the value
61
- returned may be larger than item! That constrains reasonable uses of
62
- this routine unless written as part of a conditional replacement:
63
-
64
- if item > heap[0]:
65
- item = heapreplace(heap, item)
66
- """
67
- ...
1
+ """
2
+ Heap queue algorithm (a.k.a. priority queue).
3
+
4
+ Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
5
+ all k, counting elements from 0. For the sake of comparison,
6
+ non-existing elements are considered to be infinite. The interesting
7
+ property of a heap is that a[0] is always its smallest element.
8
+
9
+ Usage:
10
+
11
+ heap = [] # creates an empty heap
12
+ heappush(heap, item) # pushes a new item on the heap
13
+ item = heappop(heap) # pops the smallest item from the heap
14
+ item = heap[0] # smallest item on the heap without popping it
15
+ heapify(x) # transforms list into a heap, in-place, in linear time
16
+ item = heapreplace(heap, item) # pops and returns smallest item, and adds
17
+ # new item; the heap size is unchanged
18
+
19
+ Our API differs from textbook heap algorithms as follows:
20
+
21
+ - We use 0-based indexing. This makes the relationship between the
22
+ index for a node and the indexes for its children slightly less
23
+ obvious, but is more suitable since Python uses 0-based indexing.
24
+
25
+ - Our heappop() method returns the smallest item, not the largest.
26
+
27
+ These two make it possible to view the heap as a regular Python list
28
+ without surprises: heap[0] is the smallest item, and heap.sort()
29
+ maintains the heap invariant!
30
+ """
31
+
32
+ from typing import Any, Final, TypeVar
33
+
34
+ _T = TypeVar("_T")
35
+
36
+ __about__: Final[str]
37
+
38
+ def heapify(heap: list[Any], /) -> None:
39
+ """Transform list into a heap, in-place, in O(len(heap)) time."""
40
+ ...
41
+ def heappop(heap: list[_T], /) -> _T:
42
+ """Pop the smallest item off the heap, maintaining the heap invariant."""
43
+ ...
44
+ def heappush(heap: list[_T], item: _T, /) -> None:
45
+ """Push item onto heap, maintaining the heap invariant."""
46
+ ...
47
+ def heappushpop(heap: list[_T], item: _T, /) -> _T:
48
+ """
49
+ Push item on the heap, then pop and return the smallest item from the heap.
50
+
51
+ The combined action runs more efficiently than heappush() followed by
52
+ a separate call to heappop().
53
+ """
54
+ ...
55
+ def heapreplace(heap: list[_T], item: _T, /) -> _T:
56
+ """
57
+ Pop and return the current smallest value, and add the new item.
58
+
59
+ This is more efficient than heappop() followed by heappush(), and can be
60
+ more appropriate when using a fixed-size heap. Note that the value
61
+ returned may be larger than item! That constrains reasonable uses of
62
+ this routine unless written as part of a conditional replacement:
63
+
64
+ if item > heap[0]:
65
+ item = heapreplace(heap, item)
66
+ """
67
+ ...
@@ -0,0 +1,16 @@
1
+ from typing import Any, SupportsIndex
2
+
3
+ class QueueError(RuntimeError): ...
4
+ class QueueNotFoundError(QueueError): ...
5
+
6
+ def bind(qid: SupportsIndex) -> None: ...
7
+ def create(maxsize: SupportsIndex, fmt: SupportsIndex) -> int: ...
8
+ def destroy(qid: SupportsIndex) -> None: ...
9
+ def get(qid: SupportsIndex) -> tuple[Any, int]: ...
10
+ def get_count(qid: SupportsIndex) -> int: ...
11
+ def get_maxsize(qid: SupportsIndex) -> int: ...
12
+ def get_queue_defaults(qid: SupportsIndex) -> tuple[int]: ...
13
+ def is_full(qid: SupportsIndex) -> bool: ...
14
+ def list_all() -> list[tuple[int, int]]: ...
15
+ def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex) -> None: ...
16
+ def release(qid: SupportsIndex) -> None: ...
@@ -0,0 +1,50 @@
1
+ import types
2
+ from collections.abc import Callable, Mapping
3
+ from typing import Final, Literal, SupportsIndex
4
+ from typing_extensions import TypeAlias
5
+
6
+ _Configs: TypeAlias = Literal["default", "isolated", "legacy", "empty", ""]
7
+
8
+ class InterpreterError(Exception): ...
9
+ class InterpreterNotFoundError(InterpreterError): ...
10
+ class NotShareableError(Exception): ...
11
+
12
+ class CrossInterpreterBufferView:
13
+ def __buffer__(self, flags: int, /) -> memoryview: ...
14
+
15
+ def new_config(name: _Configs = "isolated", /, **overides: object) -> types.SimpleNamespace: ...
16
+ def create(config: types.SimpleNamespace | _Configs | None = "isolated", *, reqrefs: bool = False) -> int: ...
17
+ def destroy(id: SupportsIndex, *, restrict: bool = False) -> None: ...
18
+ def list_all(*, require_ready: bool) -> list[tuple[int, int]]: ...
19
+ def get_current() -> tuple[int, int]: ...
20
+ def get_main() -> tuple[int, int]: ...
21
+ def is_running(id: SupportsIndex, *, restrict: bool = False) -> bool: ...
22
+ def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleNamespace: ...
23
+ def whence(id: SupportsIndex) -> int: ...
24
+ def exec(id: SupportsIndex, code: str, shared: bool | None = None, *, restrict: bool = False) -> None: ...
25
+ def call(
26
+ id: SupportsIndex,
27
+ callable: Callable[..., object],
28
+ args: tuple[object, ...] | None = None,
29
+ kwargs: dict[str, object] | None = None,
30
+ *,
31
+ restrict: bool = False,
32
+ ) -> object: ...
33
+ def run_string(
34
+ id: SupportsIndex, script: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False
35
+ ) -> None: ...
36
+ def run_func(
37
+ id: SupportsIndex, func: types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False
38
+ ) -> None: ...
39
+ def set___main___attrs(id: SupportsIndex, updates: Mapping[str, object], *, restrict: bool = False) -> None: ...
40
+ def incref(id: SupportsIndex, *, implieslink: bool = False, restrict: bool = False) -> None: ...
41
+ def decref(id: SupportsIndex, *, restrict: bool = False) -> None: ...
42
+ def is_shareable(obj: object) -> bool: ...
43
+ def capture_exception(exc: BaseException | None = None) -> types.SimpleNamespace: ...
44
+
45
+ WHENCE_UNKNOWN: Final = 0
46
+ WHENCE_RUNTIME: Final = 1
47
+ WHENCE_LEGACY_CAPI: Final = 2
48
+ WHENCE_CAPI: Final = 3
49
+ WHENCE_XI: Final = 4
50
+ WHENCE_STDLIB: Final = 5