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.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/commit.txt +1 -1
- package/dist/typeshed-fallback/stdlib/VERSIONS +2 -0
- package/dist/typeshed-fallback/stdlib/_ast.pyi +42 -279
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
- package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +15 -5
- package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +0 -18
- package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +180 -164
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/_interpqueues.pyi +16 -0
- package/dist/typeshed-fallback/stdlib/_interpreters.pyi +50 -0
- package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_msi.pyi +94 -92
- package/dist/typeshed-fallback/stdlib/_operator.pyi +0 -24
- package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/_weakrefset.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/abc.pyi +12 -4
- package/dist/typeshed-fallback/stdlib/argparse.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
- package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +35 -4
- package/dist/typeshed-fallback/stdlib/asyncio/futures.pyi +107 -15
- package/dist/typeshed-fallback/stdlib/asyncio/locks.pyi +9 -3
- package/dist/typeshed-fallback/stdlib/asyncio/queues.pyi +10 -2
- package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +23 -4
- package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +107 -12
- package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +86 -86
- package/dist/typeshed-fallback/stdlib/asyncio/windows_utils.pyi +49 -49
- package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
- package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
- package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/builtins.pyi +0 -1
- package/dist/typeshed-fallback/stdlib/bz2.pyi +59 -6
- package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/codecs.pyi +18 -6
- package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +200 -56
- package/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi +33 -14
- package/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/contextvars.pyi +99 -16
- package/dist/typeshed-fallback/stdlib/csv.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/curses/panel.pyi +16 -4
- package/dist/typeshed-fallback/stdlib/dataclasses.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/datetime.pyi +346 -104
- package/dist/typeshed-fallback/stdlib/dbm/gnu.pyi +52 -2
- package/dist/typeshed-fallback/stdlib/dbm/ndbm.pyi +26 -2
- package/dist/typeshed-fallback/stdlib/difflib.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
- package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +173 -173
- package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +99 -99
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +52 -52
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +44 -44
- package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +24 -24
- package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +39 -39
- package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
- package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +44 -44
- package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/core.pyi +57 -57
- package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +149 -149
- package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
- package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/log.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/util.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/distutils/version.pyi +38 -36
- package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/charset.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/header.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +6 -1
- package/dist/typeshed-fallback/stdlib/enum.pyi +8 -1
- package/dist/typeshed-fallback/stdlib/filecmp.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/fileinput.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
- package/dist/typeshed-fallback/stdlib/fractions.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/functools.pyi +65 -13
- package/dist/typeshed-fallback/stdlib/graphlib.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/gzip.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/hashlib.pyi +42 -14
- package/dist/typeshed-fallback/stdlib/heapq.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/hmac.pyi +30 -2
- package/dist/typeshed-fallback/stdlib/http/cookies.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
- package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/machinery.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +79 -15
- package/dist/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/resources/simple.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/io.pyi +428 -44
- package/dist/typeshed-fallback/stdlib/ipaddress.pyi +153 -28
- package/dist/typeshed-fallback/stdlib/itertools.pyi +5 -1
- package/dist/typeshed-fallback/stdlib/json/encoder.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/keyword.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +17 -3
- package/dist/typeshed-fallback/stdlib/lzma.pyi +107 -9
- package/dist/typeshed-fallback/stdlib/mailbox.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
- package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -160
- package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
- package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +9 -3
- package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +10 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/pool.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/multiprocessing/process.pyi +15 -4
- package/dist/typeshed-fallback/stdlib/multiprocessing/queues.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +19 -5
- package/dist/typeshed-fallback/stdlib/nis.pyi +31 -4
- package/dist/typeshed-fallback/stdlib/numbers.pyi +26 -6
- package/dist/typeshed-fallback/stdlib/opcode.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/optparse.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +1447 -217
- package/dist/typeshed-fallback/stdlib/pathlib.pyi +42 -11
- package/dist/typeshed-fallback/stdlib/pickle.pyi +200 -12
- package/dist/typeshed-fallback/stdlib/posixpath.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/queue.pyi +57 -9
- package/dist/typeshed-fallback/stdlib/re.pyi +219 -57
- package/dist/typeshed-fallback/stdlib/sched.pyi +8 -1
- package/dist/typeshed-fallback/stdlib/signal.pyi +95 -19
- package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/socket.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +417 -83
- package/dist/typeshed-fallback/stdlib/ssl.pyi +133 -22
- package/dist/typeshed-fallback/stdlib/statistics.pyi +20 -5
- package/dist/typeshed-fallback/stdlib/struct.pyi +114 -13
- package/dist/typeshed-fallback/stdlib/subprocess.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
- package/dist/typeshed-fallback/stdlib/symtable.pyi +30 -1
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +7 -3
- package/dist/typeshed-fallback/stdlib/tarfile.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/tempfile.pyi +17 -3
- package/dist/typeshed-fallback/stdlib/threading.pyi +68 -7
- package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/turtle.pyi +11 -3
- package/dist/typeshed-fallback/stdlib/types.pyi +306 -79
- package/dist/typeshed-fallback/stdlib/typing.pyi +310 -31
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +42 -11
- package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +6 -1
- package/dist/typeshed-fallback/stdlib/unittest/case.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +51 -3
- package/dist/typeshed-fallback/stdlib/weakref.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/winsound.pyi +44 -28
- package/dist/typeshed-fallback/stdlib/xml/dom/minicompat.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +33 -11
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +30 -10
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/errors.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/model.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/xxlimited.pyi +19 -4
- package/dist/typeshed-fallback/stdlib/zipimport.pyi +31 -0
- package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
- package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +18 -6
- package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +2 -2
- package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +18 -1
- package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +5 -19
- package/dist/typeshed-fallback/stubs/docker/docker/api/daemon.pyi +2 -1
- package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +268 -6
- package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +3 -7
- package/dist/typeshed-fallback/stubs/docker/docker/types/daemon.pyi +10 -4
- package/dist/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi +47 -0
- package/dist/typeshed-fallback/stubs/gdb/gdb/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +0 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +2 -1
- package/dist/typeshed-fallback/stubs/pygit2/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi +2 -2
- package/dist/typeshed-fallback/stubs/python-crontab/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi +23 -11
- package/dist/typeshed-fallback/stubs/reportlab/reportlab/pdfbase/pdfdoc.pyi +6 -0
- package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi +8 -8
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +11 -17
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +11 -11
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +1 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi +4 -12
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +2 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi +5 -8
- package/dist/typeshed-fallback/stubs/str2bool/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/str2bool/str2bool/__init__.pyi +7 -0
- package/package.json +1 -1
|
@@ -20,6 +20,20 @@ _T = TypeVar("_T")
|
|
|
20
20
|
def isfuture(obj: object) -> TypeIs[Future[Any]]: ...
|
|
21
21
|
|
|
22
22
|
class Future(Awaitable[_T], Iterable[_T]):
|
|
23
|
+
"""
|
|
24
|
+
This class is *almost* compatible with concurrent.futures.Future.
|
|
25
|
+
|
|
26
|
+
Differences:
|
|
27
|
+
|
|
28
|
+
- result() and exception() do not take a timeout argument and
|
|
29
|
+
raise an exception when the future isn't done yet.
|
|
30
|
+
|
|
31
|
+
- Callbacks registered with add_done_callback() are always called
|
|
32
|
+
via the event loop's call_soon_threadsafe().
|
|
33
|
+
|
|
34
|
+
- This class is not compatible with the wait() and as_completed()
|
|
35
|
+
methods in the concurrent.futures package.
|
|
36
|
+
"""
|
|
23
37
|
_state: str
|
|
24
38
|
@property
|
|
25
39
|
def _exception(self) -> BaseException | None: ...
|
|
@@ -31,27 +45,105 @@ class Future(Awaitable[_T], Iterable[_T]):
|
|
|
31
45
|
_asyncio_future_blocking: bool # is a part of duck-typing contract for `Future`
|
|
32
46
|
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
|
|
33
47
|
def __del__(self) -> None: ...
|
|
34
|
-
def get_loop(self) -> AbstractEventLoop:
|
|
48
|
+
def get_loop(self) -> AbstractEventLoop:
|
|
49
|
+
"""Return the event loop the Future is bound to."""
|
|
50
|
+
...
|
|
35
51
|
@property
|
|
36
52
|
def _callbacks(self) -> list[tuple[Callable[[Self], Any], Context]]: ...
|
|
37
|
-
def add_done_callback(self, fn: Callable[[Self], object], /, *, context: Context | None = None) -> None:
|
|
53
|
+
def add_done_callback(self, fn: Callable[[Self], object], /, *, context: Context | None = None) -> None:
|
|
54
|
+
"""
|
|
55
|
+
Add a callback to be run when the future becomes done.
|
|
56
|
+
|
|
57
|
+
The callback is called with a single argument - the future object. If
|
|
58
|
+
the future is already done when this is called, the callback is
|
|
59
|
+
scheduled with call_soon.
|
|
60
|
+
"""
|
|
61
|
+
...
|
|
38
62
|
if sys.version_info >= (3, 9):
|
|
39
|
-
def cancel(self, msg: Any | None = None) -> bool:
|
|
63
|
+
def cancel(self, msg: Any | None = None) -> bool:
|
|
64
|
+
"""
|
|
65
|
+
Cancel the future and schedule callbacks.
|
|
66
|
+
|
|
67
|
+
If the future is already done or cancelled, return False. Otherwise,
|
|
68
|
+
change the future's state to cancelled, schedule the callbacks and
|
|
69
|
+
return True.
|
|
70
|
+
"""
|
|
71
|
+
...
|
|
40
72
|
else:
|
|
41
|
-
def cancel(self) -> bool:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def
|
|
73
|
+
def cancel(self) -> bool:
|
|
74
|
+
"""
|
|
75
|
+
Cancel the future and schedule callbacks.
|
|
76
|
+
|
|
77
|
+
If the future is already done or cancelled, return False. Otherwise,
|
|
78
|
+
change the future's state to cancelled, schedule the callbacks and
|
|
79
|
+
return True.
|
|
80
|
+
"""
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
def cancelled(self) -> bool:
|
|
84
|
+
"""Return True if the future was cancelled."""
|
|
85
|
+
...
|
|
86
|
+
def done(self) -> bool:
|
|
87
|
+
"""
|
|
88
|
+
Return True if the future is done.
|
|
89
|
+
|
|
90
|
+
Done means either that a result / exception are available, or that the
|
|
91
|
+
future was cancelled.
|
|
92
|
+
"""
|
|
93
|
+
...
|
|
94
|
+
def result(self) -> _T:
|
|
95
|
+
"""
|
|
96
|
+
Return the result this future represents.
|
|
97
|
+
|
|
98
|
+
If the future has been cancelled, raises CancelledError. If the
|
|
99
|
+
future's result isn't yet available, raises InvalidStateError. If
|
|
100
|
+
the future is done and has an exception set, this exception is raised.
|
|
101
|
+
"""
|
|
102
|
+
...
|
|
103
|
+
def exception(self) -> BaseException | None:
|
|
104
|
+
"""
|
|
105
|
+
Return the exception that was set on this future.
|
|
106
|
+
|
|
107
|
+
The exception (or None if no exception was set) is returned only if
|
|
108
|
+
the future is done. If the future has been cancelled, raises
|
|
109
|
+
CancelledError. If the future isn't done yet, raises
|
|
110
|
+
InvalidStateError.
|
|
111
|
+
"""
|
|
112
|
+
...
|
|
113
|
+
def remove_done_callback(self, fn: Callable[[Self], object], /) -> int:
|
|
114
|
+
"""
|
|
115
|
+
Remove all instances of a callback from the "call when done" list.
|
|
116
|
+
|
|
117
|
+
Returns the number of callbacks removed.
|
|
118
|
+
"""
|
|
119
|
+
...
|
|
120
|
+
def set_result(self, result: _T, /) -> None:
|
|
121
|
+
"""
|
|
122
|
+
Mark the future done and set its result.
|
|
123
|
+
|
|
124
|
+
If the future is already done when this method is called, raises
|
|
125
|
+
InvalidStateError.
|
|
126
|
+
"""
|
|
127
|
+
...
|
|
128
|
+
def set_exception(self, exception: type | BaseException, /) -> None:
|
|
129
|
+
"""
|
|
130
|
+
Mark the future done and set an exception.
|
|
131
|
+
|
|
132
|
+
If the future is already done when this method is called, raises
|
|
133
|
+
InvalidStateError.
|
|
134
|
+
"""
|
|
135
|
+
...
|
|
136
|
+
def __iter__(self) -> Generator[Any, None, _T]:
|
|
137
|
+
"""Implement iter(self)."""
|
|
138
|
+
...
|
|
139
|
+
def __await__(self) -> Generator[Any, None, _T]:
|
|
140
|
+
"""Return an iterator to be used in await expression."""
|
|
141
|
+
...
|
|
52
142
|
@property
|
|
53
143
|
def _loop(self) -> AbstractEventLoop: ...
|
|
54
144
|
if sys.version_info >= (3, 9):
|
|
55
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
145
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
146
|
+
"""See PEP 585"""
|
|
147
|
+
...
|
|
56
148
|
|
|
57
149
|
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...
|
|
@@ -114,8 +114,14 @@ if sys.version_info >= (3, 11):
|
|
|
114
114
|
async def abort(self) -> None: ...
|
|
115
115
|
async def reset(self) -> None: ...
|
|
116
116
|
@property
|
|
117
|
-
def parties(self) -> int:
|
|
117
|
+
def parties(self) -> int:
|
|
118
|
+
"""Return the number of tasks required to trip the barrier."""
|
|
119
|
+
...
|
|
118
120
|
@property
|
|
119
|
-
def n_waiting(self) -> int:
|
|
121
|
+
def n_waiting(self) -> int:
|
|
122
|
+
"""Return the number of tasks currently waiting at the barrier."""
|
|
123
|
+
...
|
|
120
124
|
@property
|
|
121
|
-
def broken(self) -> bool:
|
|
125
|
+
def broken(self) -> bool:
|
|
126
|
+
"""Return True if the barrier is in a broken state."""
|
|
127
|
+
...
|
|
@@ -31,7 +31,9 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
|
|
|
31
31
|
def _format(self) -> str: ...
|
|
32
32
|
def qsize(self) -> int: ...
|
|
33
33
|
@property
|
|
34
|
-
def maxsize(self) -> int:
|
|
34
|
+
def maxsize(self) -> int:
|
|
35
|
+
"""Number of items allowed in the queue."""
|
|
36
|
+
...
|
|
35
37
|
def empty(self) -> bool: ...
|
|
36
38
|
def full(self) -> bool: ...
|
|
37
39
|
async def put(self, item: _T) -> None: ...
|
|
@@ -41,7 +43,13 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
|
|
|
41
43
|
async def join(self) -> None: ...
|
|
42
44
|
def task_done(self) -> None: ...
|
|
43
45
|
if sys.version_info >= (3, 9):
|
|
44
|
-
def __class_getitem__(cls, type: Any, /) -> GenericAlias:
|
|
46
|
+
def __class_getitem__(cls, type: Any, /) -> GenericAlias:
|
|
47
|
+
"""
|
|
48
|
+
Represent a PEP 585 generic type
|
|
49
|
+
|
|
50
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
51
|
+
"""
|
|
52
|
+
...
|
|
45
53
|
|
|
46
54
|
class PriorityQueue(Queue[_T]): ...
|
|
47
55
|
class LifoQueue(Queue[_T]): ...
|
|
@@ -50,13 +50,32 @@ if sys.version_info < (3, 11):
|
|
|
50
50
|
_shutdown_cb: Callable[[], None] | None
|
|
51
51
|
def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = None) -> None: ...
|
|
52
52
|
@property
|
|
53
|
-
def context(self) -> ssl.SSLContext:
|
|
53
|
+
def context(self) -> ssl.SSLContext:
|
|
54
|
+
"""The SSL context passed to the constructor."""
|
|
55
|
+
...
|
|
54
56
|
@property
|
|
55
|
-
def ssl_object(self) -> ssl.SSLObject | None:
|
|
57
|
+
def ssl_object(self) -> ssl.SSLObject | None:
|
|
58
|
+
"""
|
|
59
|
+
The internal ssl.SSLObject instance.
|
|
60
|
+
|
|
61
|
+
Return None if the pipe is not wrapped.
|
|
62
|
+
"""
|
|
63
|
+
...
|
|
56
64
|
@property
|
|
57
|
-
def need_ssldata(self) -> bool:
|
|
65
|
+
def need_ssldata(self) -> bool:
|
|
66
|
+
"""
|
|
67
|
+
Whether more record level data is needed to complete a handshake
|
|
68
|
+
that is currently in progress.
|
|
69
|
+
"""
|
|
70
|
+
...
|
|
58
71
|
@property
|
|
59
|
-
def wrapped(self) -> bool:
|
|
72
|
+
def wrapped(self) -> bool:
|
|
73
|
+
"""
|
|
74
|
+
Whether a security layer is currently in effect.
|
|
75
|
+
|
|
76
|
+
Return False during handshake.
|
|
77
|
+
"""
|
|
78
|
+
...
|
|
60
79
|
def do_handshake(self, callback: Callable[[BaseException | None], object] | None = None) -> list[bytes]: ...
|
|
61
80
|
def shutdown(self, callback: Callable[[], object] | None = None) -> list[bytes]: ...
|
|
62
81
|
def feed_eof(self) -> None: ...
|
|
@@ -405,6 +405,7 @@ else:
|
|
|
405
405
|
# since the only reason why `asyncio.Future` is invariant is the `set_result()` method,
|
|
406
406
|
# and `asyncio.Task.set_result()` always raises.
|
|
407
407
|
class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments]
|
|
408
|
+
"""A coroutine wrapped in a Future."""
|
|
408
409
|
if sys.version_info >= (3, 12):
|
|
409
410
|
def __init__(
|
|
410
411
|
self,
|
|
@@ -435,18 +436,82 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
|
|
|
435
436
|
if sys.version_info >= (3, 12):
|
|
436
437
|
def get_context(self) -> Context: ...
|
|
437
438
|
|
|
438
|
-
def get_stack(self, *, limit: int | None = None) -> list[FrameType]:
|
|
439
|
-
|
|
439
|
+
def get_stack(self, *, limit: int | None = None) -> list[FrameType]:
|
|
440
|
+
"""
|
|
441
|
+
Return the list of stack frames for this task's coroutine.
|
|
442
|
+
|
|
443
|
+
If the coroutine is not done, this returns the stack where it is
|
|
444
|
+
suspended. If the coroutine has completed successfully or was
|
|
445
|
+
cancelled, this returns an empty list. If the coroutine was
|
|
446
|
+
terminated by an exception, this returns the list of traceback
|
|
447
|
+
frames.
|
|
448
|
+
|
|
449
|
+
The frames are always ordered from oldest to newest.
|
|
450
|
+
|
|
451
|
+
The optional limit gives the maximum number of frames to
|
|
452
|
+
return; by default all available frames are returned. Its
|
|
453
|
+
meaning differs depending on whether a stack or a traceback is
|
|
454
|
+
returned: the newest frames of a stack are returned, but the
|
|
455
|
+
oldest frames of a traceback are returned. (This matches the
|
|
456
|
+
behavior of the traceback module.)
|
|
457
|
+
|
|
458
|
+
For reasons beyond our control, only one stack frame is
|
|
459
|
+
returned for a suspended coroutine.
|
|
460
|
+
"""
|
|
461
|
+
...
|
|
462
|
+
def print_stack(self, *, limit: int | None = None, file: TextIO | None = None) -> None:
|
|
463
|
+
"""
|
|
464
|
+
Print the stack or traceback for this task's coroutine.
|
|
465
|
+
|
|
466
|
+
This produces output similar to that of the traceback module,
|
|
467
|
+
for the frames retrieved by get_stack(). The limit argument
|
|
468
|
+
is passed to get_stack(). The file argument is an I/O stream
|
|
469
|
+
to which the output is written; by default output is written
|
|
470
|
+
to sys.stderr.
|
|
471
|
+
"""
|
|
472
|
+
...
|
|
440
473
|
if sys.version_info >= (3, 11):
|
|
441
|
-
def cancelling(self) -> int:
|
|
442
|
-
|
|
474
|
+
def cancelling(self) -> int:
|
|
475
|
+
"""
|
|
476
|
+
Return the count of the task's cancellation requests.
|
|
477
|
+
|
|
478
|
+
This count is incremented when .cancel() is called
|
|
479
|
+
and may be decremented using .uncancel().
|
|
480
|
+
"""
|
|
481
|
+
...
|
|
482
|
+
def uncancel(self) -> int:
|
|
483
|
+
"""
|
|
484
|
+
Decrement the task's count of cancellation requests.
|
|
485
|
+
|
|
486
|
+
This should be used by tasks that catch CancelledError
|
|
487
|
+
and wish to continue indefinitely until they are cancelled again.
|
|
488
|
+
|
|
489
|
+
Returns the remaining number of cancellation requests.
|
|
490
|
+
"""
|
|
491
|
+
...
|
|
443
492
|
if sys.version_info < (3, 9):
|
|
444
493
|
@classmethod
|
|
445
|
-
def current_task(cls, loop: AbstractEventLoop | None = None) -> Task[Any] | None:
|
|
494
|
+
def current_task(cls, loop: AbstractEventLoop | None = None) -> Task[Any] | None:
|
|
495
|
+
"""
|
|
496
|
+
Return the currently running task in an event loop or None.
|
|
497
|
+
|
|
498
|
+
By default the current task for the current event loop is returned.
|
|
499
|
+
|
|
500
|
+
None is returned when called not in the context of a Task.
|
|
501
|
+
"""
|
|
502
|
+
...
|
|
446
503
|
@classmethod
|
|
447
|
-
def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]:
|
|
504
|
+
def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]:
|
|
505
|
+
"""
|
|
506
|
+
Return a set of all tasks for an event loop.
|
|
507
|
+
|
|
508
|
+
By default all tasks for the current event loop are returned.
|
|
509
|
+
"""
|
|
510
|
+
...
|
|
448
511
|
if sys.version_info >= (3, 9):
|
|
449
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
512
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
513
|
+
"""See PEP 585"""
|
|
514
|
+
...
|
|
450
515
|
|
|
451
516
|
def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
|
|
452
517
|
|
|
@@ -456,9 +521,27 @@ if sys.version_info >= (3, 11):
|
|
|
456
521
|
else:
|
|
457
522
|
def create_task(coro: _CoroutineLike[_T], *, name: str | None = None) -> Task[_T]: ...
|
|
458
523
|
|
|
459
|
-
def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None:
|
|
460
|
-
|
|
461
|
-
|
|
524
|
+
def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None:
|
|
525
|
+
"""Return a currently executed task."""
|
|
526
|
+
...
|
|
527
|
+
def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None:
|
|
528
|
+
"""
|
|
529
|
+
Enter into task execution or resume suspended task.
|
|
530
|
+
|
|
531
|
+
Task belongs to loop.
|
|
532
|
+
|
|
533
|
+
Returns None.
|
|
534
|
+
"""
|
|
535
|
+
...
|
|
536
|
+
def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None:
|
|
537
|
+
"""
|
|
538
|
+
Leave task execution or suspend a task.
|
|
539
|
+
|
|
540
|
+
Task belongs to loop.
|
|
541
|
+
|
|
542
|
+
Returns None.
|
|
543
|
+
"""
|
|
544
|
+
...
|
|
462
545
|
|
|
463
546
|
if sys.version_info >= (3, 12):
|
|
464
547
|
_TaskT_co = TypeVar("_TaskT_co", bound=Task[Any], covariant=True)
|
|
@@ -496,5 +579,17 @@ if sys.version_info >= (3, 12):
|
|
|
496
579
|
context: Context | None = None,
|
|
497
580
|
) -> Task[_T_co]: ...
|
|
498
581
|
|
|
499
|
-
def _register_task(task: Task[Any]) -> None:
|
|
500
|
-
|
|
582
|
+
def _register_task(task: Task[Any]) -> None:
|
|
583
|
+
"""
|
|
584
|
+
Register a new task in asyncio as executed by loop.
|
|
585
|
+
|
|
586
|
+
Returns None.
|
|
587
|
+
"""
|
|
588
|
+
...
|
|
589
|
+
def _unregister_task(task: Task[Any]) -> None:
|
|
590
|
+
"""
|
|
591
|
+
Unregister a task.
|
|
592
|
+
|
|
593
|
+
Returns None.
|
|
594
|
+
"""
|
|
595
|
+
...
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import socket
|
|
2
|
-
import sys
|
|
3
|
-
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
|
|
4
|
-
from collections.abc import Callable
|
|
5
|
-
from typing import IO, Any, ClassVar, Literal, NoReturn
|
|
6
|
-
|
|
7
|
-
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
|
8
|
-
|
|
9
|
-
if sys.platform == "win32":
|
|
10
|
-
__all__ = (
|
|
11
|
-
"SelectorEventLoop",
|
|
12
|
-
"ProactorEventLoop",
|
|
13
|
-
"IocpProactor",
|
|
14
|
-
"DefaultEventLoopPolicy",
|
|
15
|
-
"WindowsSelectorEventLoopPolicy",
|
|
16
|
-
"WindowsProactorEventLoopPolicy",
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
NULL: Literal[0]
|
|
20
|
-
INFINITE: Literal[0xFFFFFFFF]
|
|
21
|
-
ERROR_CONNECTION_REFUSED: Literal[1225]
|
|
22
|
-
ERROR_CONNECTION_ABORTED: Literal[1236]
|
|
23
|
-
CONNECT_PIPE_INIT_DELAY: float
|
|
24
|
-
CONNECT_PIPE_MAX_DELAY: float
|
|
25
|
-
|
|
26
|
-
class PipeServer:
|
|
27
|
-
def __init__(self, address: str) -> None: ...
|
|
28
|
-
def __del__(self) -> None: ...
|
|
29
|
-
def closed(self) -> bool: ...
|
|
30
|
-
def close(self) -> None: ...
|
|
31
|
-
|
|
32
|
-
class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ...
|
|
33
|
-
|
|
34
|
-
class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
|
|
35
|
-
def __init__(self, proactor: IocpProactor | None = None) -> None: ...
|
|
36
|
-
async def create_pipe_connection(
|
|
37
|
-
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
|
|
38
|
-
) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ...
|
|
39
|
-
async def start_serving_pipe(
|
|
40
|
-
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
|
|
41
|
-
) -> list[PipeServer]: ...
|
|
42
|
-
|
|
43
|
-
class IocpProactor:
|
|
44
|
-
def __init__(self, concurrency: int = 0xFFFFFFFF) -> None: ...
|
|
45
|
-
def __del__(self) -> None: ...
|
|
46
|
-
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
|
|
47
|
-
def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ...
|
|
48
|
-
def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ...
|
|
49
|
-
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
|
|
50
|
-
def recvfrom(
|
|
51
|
-
self, conn: socket.socket, nbytes: int, flags: int = 0
|
|
52
|
-
) -> futures.Future[tuple[bytes, socket._RetAddress]]: ...
|
|
53
|
-
def sendto(
|
|
54
|
-
self, conn: socket.socket, buf: ReadableBuffer, flags: int = 0, addr: socket._Address | None = None
|
|
55
|
-
) -> futures.Future[int]: ...
|
|
56
|
-
def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
|
|
57
|
-
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
|
|
58
|
-
def connect(
|
|
59
|
-
self,
|
|
60
|
-
conn: socket.socket,
|
|
61
|
-
address: tuple[Incomplete, Incomplete] | tuple[Incomplete, Incomplete, Incomplete, Incomplete],
|
|
62
|
-
) -> futures.Future[Any]: ...
|
|
63
|
-
def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ...
|
|
64
|
-
def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ...
|
|
65
|
-
async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ...
|
|
66
|
-
def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ...
|
|
67
|
-
def close(self) -> None: ...
|
|
68
|
-
if sys.version_info >= (3, 11):
|
|
69
|
-
def recvfrom_into(
|
|
70
|
-
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
|
|
71
|
-
) -> futures.Future[tuple[int, socket._RetAddress]]: ...
|
|
72
|
-
|
|
73
|
-
SelectorEventLoop = _WindowsSelectorEventLoop
|
|
74
|
-
|
|
75
|
-
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
|
76
|
-
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
|
77
|
-
if sys.version_info < (3, 14):
|
|
78
|
-
def get_child_watcher(self) -> NoReturn: ...
|
|
79
|
-
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
|
80
|
-
|
|
81
|
-
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
|
82
|
-
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
|
83
|
-
def get_child_watcher(self) -> NoReturn: ...
|
|
84
|
-
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
|
85
|
-
|
|
86
|
-
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
|
1
|
+
import socket
|
|
2
|
+
import sys
|
|
3
|
+
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
from typing import IO, Any, ClassVar, Literal, NoReturn
|
|
6
|
+
|
|
7
|
+
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
|
8
|
+
|
|
9
|
+
if sys.platform == "win32":
|
|
10
|
+
__all__ = (
|
|
11
|
+
"SelectorEventLoop",
|
|
12
|
+
"ProactorEventLoop",
|
|
13
|
+
"IocpProactor",
|
|
14
|
+
"DefaultEventLoopPolicy",
|
|
15
|
+
"WindowsSelectorEventLoopPolicy",
|
|
16
|
+
"WindowsProactorEventLoopPolicy",
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
NULL: Literal[0]
|
|
20
|
+
INFINITE: Literal[0xFFFFFFFF]
|
|
21
|
+
ERROR_CONNECTION_REFUSED: Literal[1225]
|
|
22
|
+
ERROR_CONNECTION_ABORTED: Literal[1236]
|
|
23
|
+
CONNECT_PIPE_INIT_DELAY: float
|
|
24
|
+
CONNECT_PIPE_MAX_DELAY: float
|
|
25
|
+
|
|
26
|
+
class PipeServer:
|
|
27
|
+
def __init__(self, address: str) -> None: ...
|
|
28
|
+
def __del__(self) -> None: ...
|
|
29
|
+
def closed(self) -> bool: ...
|
|
30
|
+
def close(self) -> None: ...
|
|
31
|
+
|
|
32
|
+
class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ...
|
|
33
|
+
|
|
34
|
+
class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
|
|
35
|
+
def __init__(self, proactor: IocpProactor | None = None) -> None: ...
|
|
36
|
+
async def create_pipe_connection(
|
|
37
|
+
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
|
|
38
|
+
) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ...
|
|
39
|
+
async def start_serving_pipe(
|
|
40
|
+
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
|
|
41
|
+
) -> list[PipeServer]: ...
|
|
42
|
+
|
|
43
|
+
class IocpProactor:
|
|
44
|
+
def __init__(self, concurrency: int = 0xFFFFFFFF) -> None: ...
|
|
45
|
+
def __del__(self) -> None: ...
|
|
46
|
+
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
|
|
47
|
+
def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ...
|
|
48
|
+
def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ...
|
|
49
|
+
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
|
|
50
|
+
def recvfrom(
|
|
51
|
+
self, conn: socket.socket, nbytes: int, flags: int = 0
|
|
52
|
+
) -> futures.Future[tuple[bytes, socket._RetAddress]]: ...
|
|
53
|
+
def sendto(
|
|
54
|
+
self, conn: socket.socket, buf: ReadableBuffer, flags: int = 0, addr: socket._Address | None = None
|
|
55
|
+
) -> futures.Future[int]: ...
|
|
56
|
+
def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
|
|
57
|
+
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
|
|
58
|
+
def connect(
|
|
59
|
+
self,
|
|
60
|
+
conn: socket.socket,
|
|
61
|
+
address: tuple[Incomplete, Incomplete] | tuple[Incomplete, Incomplete, Incomplete, Incomplete],
|
|
62
|
+
) -> futures.Future[Any]: ...
|
|
63
|
+
def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ...
|
|
64
|
+
def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ...
|
|
65
|
+
async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ...
|
|
66
|
+
def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ...
|
|
67
|
+
def close(self) -> None: ...
|
|
68
|
+
if sys.version_info >= (3, 11):
|
|
69
|
+
def recvfrom_into(
|
|
70
|
+
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
|
|
71
|
+
) -> futures.Future[tuple[int, socket._RetAddress]]: ...
|
|
72
|
+
|
|
73
|
+
SelectorEventLoop = _WindowsSelectorEventLoop
|
|
74
|
+
|
|
75
|
+
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
|
76
|
+
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
|
77
|
+
if sys.version_info < (3, 14):
|
|
78
|
+
def get_child_watcher(self) -> NoReturn: ...
|
|
79
|
+
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
|
80
|
+
|
|
81
|
+
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
|
82
|
+
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
|
83
|
+
def get_child_watcher(self) -> NoReturn: ...
|
|
84
|
+
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
|
85
|
+
|
|
86
|
+
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import subprocess
|
|
2
|
-
import sys
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from types import TracebackType
|
|
5
|
-
from typing import Any, AnyStr, Literal
|
|
6
|
-
from typing_extensions import Self
|
|
7
|
-
|
|
8
|
-
if sys.platform == "win32":
|
|
9
|
-
__all__ = ("pipe", "Popen", "PIPE", "PipeHandle")
|
|
10
|
-
|
|
11
|
-
BUFSIZE: Literal[8192]
|
|
12
|
-
PIPE = subprocess.PIPE
|
|
13
|
-
STDOUT = subprocess.STDOUT
|
|
14
|
-
def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = (True, True), bufsize: int = 8192) -> tuple[int, int]: ...
|
|
15
|
-
|
|
16
|
-
class PipeHandle:
|
|
17
|
-
def __init__(self, handle: int) -> None: ...
|
|
18
|
-
def __del__(self) -> None: ...
|
|
19
|
-
def __enter__(self) -> Self: ...
|
|
20
|
-
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
|
|
21
|
-
@property
|
|
22
|
-
def handle(self) -> int: ...
|
|
23
|
-
def fileno(self) -> int: ...
|
|
24
|
-
def close(self, *, CloseHandle: Callable[[int], object] = ...) -> None: ...
|
|
25
|
-
|
|
26
|
-
class Popen(subprocess.Popen[AnyStr]):
|
|
27
|
-
stdin: PipeHandle | None # type: ignore[assignment]
|
|
28
|
-
stdout: PipeHandle | None # type: ignore[assignment]
|
|
29
|
-
stderr: PipeHandle | None # type: ignore[assignment]
|
|
30
|
-
# For simplicity we omit the full overloaded __new__ signature of
|
|
31
|
-
# subprocess.Popen. The arguments are mostly the same, but
|
|
32
|
-
# subprocess.Popen takes other positional-or-keyword arguments before
|
|
33
|
-
# stdin.
|
|
34
|
-
def __new__(
|
|
35
|
-
cls,
|
|
36
|
-
args: subprocess._CMD,
|
|
37
|
-
stdin: subprocess._FILE | None = ...,
|
|
38
|
-
stdout: subprocess._FILE | None = ...,
|
|
39
|
-
stderr: subprocess._FILE | None = ...,
|
|
40
|
-
**kwds: Any,
|
|
41
|
-
) -> Self: ...
|
|
42
|
-
def __init__(
|
|
43
|
-
self,
|
|
44
|
-
args: subprocess._CMD,
|
|
45
|
-
stdin: subprocess._FILE | None = None,
|
|
46
|
-
stdout: subprocess._FILE | None = None,
|
|
47
|
-
stderr: subprocess._FILE | None = None,
|
|
48
|
-
**kwds: Any,
|
|
49
|
-
) -> None: ...
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from types import TracebackType
|
|
5
|
+
from typing import Any, AnyStr, Literal
|
|
6
|
+
from typing_extensions import Self
|
|
7
|
+
|
|
8
|
+
if sys.platform == "win32":
|
|
9
|
+
__all__ = ("pipe", "Popen", "PIPE", "PipeHandle")
|
|
10
|
+
|
|
11
|
+
BUFSIZE: Literal[8192]
|
|
12
|
+
PIPE = subprocess.PIPE
|
|
13
|
+
STDOUT = subprocess.STDOUT
|
|
14
|
+
def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = (True, True), bufsize: int = 8192) -> tuple[int, int]: ...
|
|
15
|
+
|
|
16
|
+
class PipeHandle:
|
|
17
|
+
def __init__(self, handle: int) -> None: ...
|
|
18
|
+
def __del__(self) -> None: ...
|
|
19
|
+
def __enter__(self) -> Self: ...
|
|
20
|
+
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
|
|
21
|
+
@property
|
|
22
|
+
def handle(self) -> int: ...
|
|
23
|
+
def fileno(self) -> int: ...
|
|
24
|
+
def close(self, *, CloseHandle: Callable[[int], object] = ...) -> None: ...
|
|
25
|
+
|
|
26
|
+
class Popen(subprocess.Popen[AnyStr]):
|
|
27
|
+
stdin: PipeHandle | None # type: ignore[assignment]
|
|
28
|
+
stdout: PipeHandle | None # type: ignore[assignment]
|
|
29
|
+
stderr: PipeHandle | None # type: ignore[assignment]
|
|
30
|
+
# For simplicity we omit the full overloaded __new__ signature of
|
|
31
|
+
# subprocess.Popen. The arguments are mostly the same, but
|
|
32
|
+
# subprocess.Popen takes other positional-or-keyword arguments before
|
|
33
|
+
# stdin.
|
|
34
|
+
def __new__(
|
|
35
|
+
cls,
|
|
36
|
+
args: subprocess._CMD,
|
|
37
|
+
stdin: subprocess._FILE | None = ...,
|
|
38
|
+
stdout: subprocess._FILE | None = ...,
|
|
39
|
+
stderr: subprocess._FILE | None = ...,
|
|
40
|
+
**kwds: Any,
|
|
41
|
+
) -> Self: ...
|
|
42
|
+
def __init__(
|
|
43
|
+
self,
|
|
44
|
+
args: subprocess._CMD,
|
|
45
|
+
stdin: subprocess._FILE | None = None,
|
|
46
|
+
stdout: subprocess._FILE | None = None,
|
|
47
|
+
stderr: subprocess._FILE | None = None,
|
|
48
|
+
**kwds: Any,
|
|
49
|
+
) -> None: ...
|