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
|
@@ -236,42 +236,105 @@ class UserString(Sequence[UserString]):
|
|
|
236
236
|
|
|
237
237
|
class deque(MutableSequence[_T]):
|
|
238
238
|
@property
|
|
239
|
-
def maxlen(self) -> int | None:
|
|
239
|
+
def maxlen(self) -> int | None:
|
|
240
|
+
"""maximum size of a deque or None if unbounded"""
|
|
241
|
+
...
|
|
240
242
|
@overload
|
|
241
243
|
def __init__(self, *, maxlen: int | None = None) -> None: ...
|
|
242
244
|
@overload
|
|
243
245
|
def __init__(self, iterable: Iterable[_T], maxlen: int | None = None) -> None: ...
|
|
244
|
-
def append(self, x: _T, /) -> None:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
def
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
def
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
def
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
def
|
|
257
|
-
|
|
246
|
+
def append(self, x: _T, /) -> None:
|
|
247
|
+
"""Add an element to the right side of the deque."""
|
|
248
|
+
...
|
|
249
|
+
def appendleft(self, x: _T, /) -> None:
|
|
250
|
+
"""Add an element to the left side of the deque."""
|
|
251
|
+
...
|
|
252
|
+
def copy(self) -> Self:
|
|
253
|
+
"""Return a shallow copy of a deque."""
|
|
254
|
+
...
|
|
255
|
+
def count(self, x: _T, /) -> int:
|
|
256
|
+
"""D.count(value) -> integer -- return number of occurrences of value"""
|
|
257
|
+
...
|
|
258
|
+
def extend(self, iterable: Iterable[_T], /) -> None:
|
|
259
|
+
"""Extend the right side of the deque with elements from the iterable"""
|
|
260
|
+
...
|
|
261
|
+
def extendleft(self, iterable: Iterable[_T], /) -> None:
|
|
262
|
+
"""Extend the left side of the deque with elements from the iterable"""
|
|
263
|
+
...
|
|
264
|
+
def insert(self, i: int, x: _T, /) -> None:
|
|
265
|
+
"""D.insert(index, object) -- insert object before index"""
|
|
266
|
+
...
|
|
267
|
+
def index(self, x: _T, start: int = 0, stop: int = ..., /) -> int:
|
|
268
|
+
"""
|
|
269
|
+
D.index(value, [start, [stop]]) -> integer -- return first index of value.
|
|
270
|
+
Raises ValueError if the value is not present.
|
|
271
|
+
"""
|
|
272
|
+
...
|
|
273
|
+
def pop(self) -> _T:
|
|
274
|
+
"""Remove and return the rightmost element."""
|
|
275
|
+
...
|
|
276
|
+
def popleft(self) -> _T:
|
|
277
|
+
"""Remove and return the leftmost element."""
|
|
278
|
+
...
|
|
279
|
+
def remove(self, value: _T, /) -> None:
|
|
280
|
+
"""D.remove(value) -- remove first occurrence of value."""
|
|
281
|
+
...
|
|
282
|
+
def rotate(self, n: int = 1, /) -> None:
|
|
283
|
+
"""Rotate the deque n steps to the right (default n=1). If n is negative, rotates left."""
|
|
284
|
+
...
|
|
285
|
+
def __copy__(self) -> Self:
|
|
286
|
+
"""Return a shallow copy of a deque."""
|
|
287
|
+
...
|
|
288
|
+
def __len__(self) -> int:
|
|
289
|
+
"""Return len(self)."""
|
|
290
|
+
...
|
|
258
291
|
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
|
|
259
|
-
def __getitem__(self, key: SupportsIndex, /) -> _T:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
def
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
def
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
def
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
def
|
|
272
|
-
|
|
292
|
+
def __getitem__(self, key: SupportsIndex, /) -> _T:
|
|
293
|
+
"""Return self[key]."""
|
|
294
|
+
...
|
|
295
|
+
def __setitem__(self, key: SupportsIndex, value: _T, /) -> None:
|
|
296
|
+
"""Set self[key] to value."""
|
|
297
|
+
...
|
|
298
|
+
def __delitem__(self, key: SupportsIndex, /) -> None:
|
|
299
|
+
"""Delete self[key]."""
|
|
300
|
+
...
|
|
301
|
+
def __contains__(self, key: object, /) -> bool:
|
|
302
|
+
"""Return key in self."""
|
|
303
|
+
...
|
|
304
|
+
def __reduce__(self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]:
|
|
305
|
+
"""Return state information for pickling."""
|
|
306
|
+
...
|
|
307
|
+
def __iadd__(self, value: Iterable[_T], /) -> Self:
|
|
308
|
+
"""Implement self+=value."""
|
|
309
|
+
...
|
|
310
|
+
def __add__(self, value: Self, /) -> Self:
|
|
311
|
+
"""Return self+value."""
|
|
312
|
+
...
|
|
313
|
+
def __mul__(self, value: int, /) -> Self:
|
|
314
|
+
"""Return self*value."""
|
|
315
|
+
...
|
|
316
|
+
def __imul__(self, value: int, /) -> Self:
|
|
317
|
+
"""Implement self*=value."""
|
|
318
|
+
...
|
|
319
|
+
def __lt__(self, value: deque[_T], /) -> bool:
|
|
320
|
+
"""Return self<value."""
|
|
321
|
+
...
|
|
322
|
+
def __le__(self, value: deque[_T], /) -> bool:
|
|
323
|
+
"""Return self<=value."""
|
|
324
|
+
...
|
|
325
|
+
def __gt__(self, value: deque[_T], /) -> bool:
|
|
326
|
+
"""Return self>value."""
|
|
327
|
+
...
|
|
328
|
+
def __ge__(self, value: deque[_T], /) -> bool:
|
|
329
|
+
"""Return self>=value."""
|
|
330
|
+
...
|
|
331
|
+
def __eq__(self, value: object, /) -> bool:
|
|
332
|
+
"""Return self==value."""
|
|
333
|
+
...
|
|
273
334
|
if sys.version_info >= (3, 9):
|
|
274
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
335
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
336
|
+
"""See PEP 585"""
|
|
337
|
+
...
|
|
275
338
|
|
|
276
339
|
class Counter(dict[_T, int], Generic[_T]):
|
|
277
340
|
@overload
|
|
@@ -357,10 +420,26 @@ class _odict_values(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT
|
|
|
357
420
|
def __reversed__(self) -> Iterator[_VT_co]: ...
|
|
358
421
|
|
|
359
422
|
class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
|
360
|
-
def popitem(self, last: bool = True) -> tuple[_KT, _VT]:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
423
|
+
def popitem(self, last: bool = True) -> tuple[_KT, _VT]:
|
|
424
|
+
"""
|
|
425
|
+
Remove and return a (key, value) pair from the dictionary.
|
|
426
|
+
|
|
427
|
+
Pairs are returned in LIFO order if last is true or FIFO order if false.
|
|
428
|
+
"""
|
|
429
|
+
...
|
|
430
|
+
def move_to_end(self, key: _KT, last: bool = True) -> None:
|
|
431
|
+
"""
|
|
432
|
+
Move an existing element to the end (or beginning if last is false).
|
|
433
|
+
|
|
434
|
+
Raise KeyError if the element does not exist.
|
|
435
|
+
"""
|
|
436
|
+
...
|
|
437
|
+
def copy(self) -> Self:
|
|
438
|
+
"""od.copy() -> a shallow copy of od"""
|
|
439
|
+
...
|
|
440
|
+
def __reversed__(self) -> Iterator[_KT]:
|
|
441
|
+
"""od.__reversed__() <==> reversed(od)"""
|
|
442
|
+
...
|
|
364
443
|
def keys(self) -> _odict_keys[_KT, _VT]: ...
|
|
365
444
|
def items(self) -> _odict_items[_KT, _VT]: ...
|
|
366
445
|
def values(self) -> _odict_values[_KT, _VT]: ...
|
|
@@ -369,32 +448,76 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
|
|
369
448
|
# See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963.
|
|
370
449
|
@classmethod
|
|
371
450
|
@overload
|
|
372
|
-
def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]:
|
|
451
|
+
def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]:
|
|
452
|
+
"""Create a new ordered dictionary with keys from iterable and values set to value."""
|
|
453
|
+
...
|
|
373
454
|
@classmethod
|
|
374
455
|
@overload
|
|
375
|
-
def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]:
|
|
456
|
+
def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]:
|
|
457
|
+
"""Create a new ordered dictionary with keys from iterable and values set to value."""
|
|
458
|
+
...
|
|
376
459
|
# Keep OrderedDict.setdefault in line with MutableMapping.setdefault, modulo positional-only differences.
|
|
377
460
|
@overload
|
|
378
|
-
def setdefault(self: OrderedDict[_KT, _T | None], key: _KT, default: None = None) -> _T | None:
|
|
461
|
+
def setdefault(self: OrderedDict[_KT, _T | None], key: _KT, default: None = None) -> _T | None:
|
|
462
|
+
"""
|
|
463
|
+
Insert key with a value of default if key is not in the dictionary.
|
|
464
|
+
|
|
465
|
+
Return the value for key if key is in the dictionary, else default.
|
|
466
|
+
"""
|
|
467
|
+
...
|
|
379
468
|
@overload
|
|
380
|
-
def setdefault(self, key: _KT, default: _VT) -> _VT:
|
|
469
|
+
def setdefault(self, key: _KT, default: _VT) -> _VT:
|
|
470
|
+
"""
|
|
471
|
+
Insert key with a value of default if key is not in the dictionary.
|
|
472
|
+
|
|
473
|
+
Return the value for key if key is in the dictionary, else default.
|
|
474
|
+
"""
|
|
475
|
+
...
|
|
381
476
|
# Same as dict.pop, but accepts keyword arguments
|
|
382
477
|
@overload
|
|
383
|
-
def pop(self, key: _KT) -> _VT:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
478
|
+
def pop(self, key: _KT) -> _VT:
|
|
479
|
+
"""
|
|
480
|
+
od.pop(k[,d]) -> v, remove specified key and return the corresponding
|
|
481
|
+
value. If key is not found, d is returned if given, otherwise KeyError
|
|
482
|
+
is raised.
|
|
483
|
+
"""
|
|
484
|
+
...
|
|
485
|
+
@overload
|
|
486
|
+
def pop(self, key: _KT, default: _VT) -> _VT:
|
|
487
|
+
"""
|
|
488
|
+
od.pop(k[,d]) -> v, remove specified key and return the corresponding
|
|
489
|
+
value. If key is not found, d is returned if given, otherwise KeyError
|
|
490
|
+
is raised.
|
|
491
|
+
"""
|
|
492
|
+
...
|
|
493
|
+
@overload
|
|
494
|
+
def pop(self, key: _KT, default: _T) -> _VT | _T:
|
|
495
|
+
"""
|
|
496
|
+
od.pop(k[,d]) -> v, remove specified key and return the corresponding
|
|
497
|
+
value. If key is not found, d is returned if given, otherwise KeyError
|
|
498
|
+
is raised.
|
|
499
|
+
"""
|
|
500
|
+
...
|
|
501
|
+
def __eq__(self, value: object, /) -> bool:
|
|
502
|
+
"""Return self==value."""
|
|
503
|
+
...
|
|
389
504
|
if sys.version_info >= (3, 9):
|
|
390
505
|
@overload
|
|
391
|
-
def __or__(self, value: dict[_KT, _VT], /) -> Self:
|
|
506
|
+
def __or__(self, value: dict[_KT, _VT], /) -> Self:
|
|
507
|
+
"""Return self|value."""
|
|
508
|
+
...
|
|
392
509
|
@overload
|
|
393
|
-
def __or__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]:
|
|
510
|
+
def __or__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]:
|
|
511
|
+
"""Return self|value."""
|
|
512
|
+
...
|
|
394
513
|
@overload
|
|
395
|
-
def __ror__(self, value: dict[_KT, _VT], /) -> Self:
|
|
514
|
+
def __ror__(self, value: dict[_KT, _VT], /) -> Self:
|
|
515
|
+
"""Return value|self."""
|
|
516
|
+
...
|
|
396
517
|
@overload
|
|
397
|
-
def __ror__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]:
|
|
518
|
+
def __ror__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]:
|
|
519
|
+
"""Return value|self."""
|
|
520
|
+
...
|
|
398
521
|
|
|
399
522
|
class defaultdict(dict[_KT, _VT]):
|
|
400
523
|
default_factory: Callable[[], _VT] | None
|
|
@@ -431,25 +554,46 @@ class defaultdict(dict[_KT, _VT]):
|
|
|
431
554
|
/,
|
|
432
555
|
**kwargs: _VT,
|
|
433
556
|
) -> None: ...
|
|
434
|
-
def __missing__(self, key: _KT, /) -> _VT:
|
|
435
|
-
|
|
436
|
-
|
|
557
|
+
def __missing__(self, key: _KT, /) -> _VT:
|
|
558
|
+
"""
|
|
559
|
+
__missing__(key) # Called by __getitem__ for missing key; pseudo-code:
|
|
560
|
+
if self.default_factory is None: raise KeyError((key,))
|
|
561
|
+
self[key] = value = self.default_factory()
|
|
562
|
+
return value
|
|
563
|
+
"""
|
|
564
|
+
...
|
|
565
|
+
def __copy__(self) -> Self:
|
|
566
|
+
"""D.copy() -> a shallow copy of D."""
|
|
567
|
+
...
|
|
568
|
+
def copy(self) -> Self:
|
|
569
|
+
"""D.copy() -> a shallow copy of D."""
|
|
570
|
+
...
|
|
437
571
|
if sys.version_info >= (3, 9):
|
|
438
572
|
@overload
|
|
439
|
-
def __or__(self, value: dict[_KT, _VT], /) -> Self:
|
|
573
|
+
def __or__(self, value: dict[_KT, _VT], /) -> Self:
|
|
574
|
+
"""Return self|value."""
|
|
575
|
+
...
|
|
440
576
|
@overload
|
|
441
|
-
def __or__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]:
|
|
577
|
+
def __or__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]:
|
|
578
|
+
"""Return self|value."""
|
|
579
|
+
...
|
|
442
580
|
@overload
|
|
443
|
-
def __ror__(self, value: dict[_KT, _VT], /) -> Self:
|
|
581
|
+
def __ror__(self, value: dict[_KT, _VT], /) -> Self:
|
|
582
|
+
"""Return value|self."""
|
|
583
|
+
...
|
|
444
584
|
@overload
|
|
445
|
-
def __ror__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]:
|
|
585
|
+
def __ror__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]:
|
|
586
|
+
"""Return value|self."""
|
|
587
|
+
...
|
|
446
588
|
|
|
447
589
|
class ChainMap(MutableMapping[_KT, _VT]):
|
|
448
590
|
maps: list[MutableMapping[_KT, _VT]]
|
|
449
591
|
def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ...
|
|
450
592
|
def new_child(self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ...
|
|
451
593
|
@property
|
|
452
|
-
def parents(self) -> Self:
|
|
594
|
+
def parents(self) -> Self:
|
|
595
|
+
"""New ChainMap from maps[1:]."""
|
|
596
|
+
...
|
|
453
597
|
def __setitem__(self, key: _KT, value: _VT) -> None: ...
|
|
454
598
|
def __delitem__(self, key: _KT) -> None: ...
|
|
455
599
|
def __getitem__(self, key: _KT) -> _VT: ...
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
1
3
|
from ._base import (
|
|
2
4
|
ALL_COMPLETED as ALL_COMPLETED,
|
|
3
5
|
FIRST_COMPLETED as FIRST_COMPLETED,
|
|
@@ -14,19 +16,36 @@ from ._base import (
|
|
|
14
16
|
from .process import ProcessPoolExecutor as ProcessPoolExecutor
|
|
15
17
|
from .thread import ThreadPoolExecutor as ThreadPoolExecutor
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
if sys.version_info >= (3, 13):
|
|
20
|
+
__all__ = (
|
|
21
|
+
"FIRST_COMPLETED",
|
|
22
|
+
"FIRST_EXCEPTION",
|
|
23
|
+
"ALL_COMPLETED",
|
|
24
|
+
"CancelledError",
|
|
25
|
+
"TimeoutError",
|
|
26
|
+
"InvalidStateError",
|
|
27
|
+
"BrokenExecutor",
|
|
28
|
+
"Future",
|
|
29
|
+
"Executor",
|
|
30
|
+
"wait",
|
|
31
|
+
"as_completed",
|
|
32
|
+
"ProcessPoolExecutor",
|
|
33
|
+
"ThreadPoolExecutor",
|
|
34
|
+
)
|
|
35
|
+
else:
|
|
36
|
+
__all__ = (
|
|
37
|
+
"FIRST_COMPLETED",
|
|
38
|
+
"FIRST_EXCEPTION",
|
|
39
|
+
"ALL_COMPLETED",
|
|
40
|
+
"CancelledError",
|
|
41
|
+
"TimeoutError",
|
|
42
|
+
"BrokenExecutor",
|
|
43
|
+
"Future",
|
|
44
|
+
"Executor",
|
|
45
|
+
"wait",
|
|
46
|
+
"as_completed",
|
|
47
|
+
"ProcessPoolExecutor",
|
|
48
|
+
"ThreadPoolExecutor",
|
|
49
|
+
)
|
|
31
50
|
|
|
32
51
|
def __dir__() -> tuple[str, ...]: ...
|
|
@@ -54,7 +54,13 @@ class Future(Generic[_T]):
|
|
|
54
54
|
def exception(self, timeout: float | None = None) -> BaseException | None: ...
|
|
55
55
|
def set_exception(self, exception: BaseException | None) -> None: ...
|
|
56
56
|
if sys.version_info >= (3, 9):
|
|
57
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
57
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
58
|
+
"""
|
|
59
|
+
Represent a PEP 585 generic type
|
|
60
|
+
|
|
61
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
62
|
+
"""
|
|
63
|
+
...
|
|
58
64
|
|
|
59
65
|
class Executor:
|
|
60
66
|
if sys.version_info >= (3, 9):
|
|
@@ -29,7 +29,13 @@ class _WorkItem(Generic[_S]):
|
|
|
29
29
|
def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
|
|
30
30
|
def run(self) -> None: ...
|
|
31
31
|
if sys.version_info >= (3, 9):
|
|
32
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
32
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
33
|
+
"""
|
|
34
|
+
Represent a PEP 585 generic type
|
|
35
|
+
|
|
36
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
37
|
+
"""
|
|
38
|
+
...
|
|
33
39
|
|
|
34
40
|
def _worker(
|
|
35
41
|
executor_reference: ref[Any],
|
|
@@ -18,19 +18,69 @@ class ContextVar(Generic[_T]):
|
|
|
18
18
|
def __init__(self, name: str) -> None: ...
|
|
19
19
|
@overload
|
|
20
20
|
def __init__(self, name: str, *, default: _T) -> None: ...
|
|
21
|
-
def __hash__(self) -> int:
|
|
21
|
+
def __hash__(self) -> int:
|
|
22
|
+
"""Return hash(self)."""
|
|
23
|
+
...
|
|
22
24
|
@property
|
|
23
25
|
def name(self) -> str: ...
|
|
24
26
|
@overload
|
|
25
|
-
def get(self) -> _T:
|
|
27
|
+
def get(self) -> _T:
|
|
28
|
+
"""
|
|
29
|
+
Return a value for the context variable for the current context.
|
|
30
|
+
|
|
31
|
+
If there is no value for the variable in the current context, the method will:
|
|
32
|
+
* return the value of the default argument of the method, if provided; or
|
|
33
|
+
* return the default value for the context variable, if it was created
|
|
34
|
+
with one; or
|
|
35
|
+
* raise a LookupError.
|
|
36
|
+
"""
|
|
37
|
+
...
|
|
26
38
|
@overload
|
|
27
|
-
def get(self, default: _T, /) -> _T:
|
|
39
|
+
def get(self, default: _T, /) -> _T:
|
|
40
|
+
"""
|
|
41
|
+
Return a value for the context variable for the current context.
|
|
42
|
+
|
|
43
|
+
If there is no value for the variable in the current context, the method will:
|
|
44
|
+
* return the value of the default argument of the method, if provided; or
|
|
45
|
+
* return the default value for the context variable, if it was created
|
|
46
|
+
with one; or
|
|
47
|
+
* raise a LookupError.
|
|
48
|
+
"""
|
|
49
|
+
...
|
|
28
50
|
@overload
|
|
29
|
-
def get(self, default: _D, /) -> _D | _T:
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
def get(self, default: _D, /) -> _D | _T:
|
|
52
|
+
"""
|
|
53
|
+
Return a value for the context variable for the current context.
|
|
54
|
+
|
|
55
|
+
If there is no value for the variable in the current context, the method will:
|
|
56
|
+
* return the value of the default argument of the method, if provided; or
|
|
57
|
+
* return the default value for the context variable, if it was created
|
|
58
|
+
with one; or
|
|
59
|
+
* raise a LookupError.
|
|
60
|
+
"""
|
|
61
|
+
...
|
|
62
|
+
def set(self, value: _T, /) -> Token[_T]:
|
|
63
|
+
"""
|
|
64
|
+
Call to set a new value for the context variable in the current context.
|
|
65
|
+
|
|
66
|
+
The required value argument is the new value for the context variable.
|
|
67
|
+
|
|
68
|
+
Returns a Token object that can be used to restore the variable to its previous
|
|
69
|
+
value via the `ContextVar.reset()` method.
|
|
70
|
+
"""
|
|
71
|
+
...
|
|
72
|
+
def reset(self, token: Token[_T], /) -> None:
|
|
73
|
+
"""
|
|
74
|
+
Reset the context variable.
|
|
75
|
+
|
|
76
|
+
The variable is reset to the value it had before the `ContextVar.set()` that
|
|
77
|
+
created the token was used.
|
|
78
|
+
"""
|
|
79
|
+
...
|
|
32
80
|
if sys.version_info >= (3, 9):
|
|
33
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
81
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
82
|
+
"""See PEP 585"""
|
|
83
|
+
...
|
|
34
84
|
|
|
35
85
|
@final
|
|
36
86
|
class Token(Generic[_T]):
|
|
@@ -40,7 +90,9 @@ class Token(Generic[_T]):
|
|
|
40
90
|
def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express
|
|
41
91
|
MISSING: ClassVar[object]
|
|
42
92
|
if sys.version_info >= (3, 9):
|
|
43
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
93
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
94
|
+
"""See PEP 585"""
|
|
95
|
+
...
|
|
44
96
|
|
|
45
97
|
def copy_context() -> Context: ...
|
|
46
98
|
|
|
@@ -50,14 +102,45 @@ def copy_context() -> Context: ...
|
|
|
50
102
|
class Context(Mapping[ContextVar[Any], Any]):
|
|
51
103
|
def __init__(self) -> None: ...
|
|
52
104
|
@overload
|
|
53
|
-
def get(self, key: ContextVar[_T], default: None = None, /) -> _T | None:
|
|
105
|
+
def get(self, key: ContextVar[_T], default: None = None, /) -> _T | None:
|
|
106
|
+
"""
|
|
107
|
+
Return the value for `key` if `key` has the value in the context object.
|
|
108
|
+
|
|
109
|
+
If `key` does not exist, return `default`. If `default` is not given,
|
|
110
|
+
return None.
|
|
111
|
+
"""
|
|
112
|
+
...
|
|
54
113
|
@overload
|
|
55
|
-
def get(self, key: ContextVar[_T], default: _T, /) -> _T:
|
|
114
|
+
def get(self, key: ContextVar[_T], default: _T, /) -> _T:
|
|
115
|
+
"""
|
|
116
|
+
Return the value for `key` if `key` has the value in the context object.
|
|
117
|
+
|
|
118
|
+
If `key` does not exist, return `default`. If `default` is not given,
|
|
119
|
+
return None.
|
|
120
|
+
"""
|
|
121
|
+
...
|
|
56
122
|
@overload
|
|
57
|
-
def get(self, key: ContextVar[_T], default: _D, /) -> _T | _D:
|
|
123
|
+
def get(self, key: ContextVar[_T], default: _D, /) -> _T | _D:
|
|
124
|
+
"""
|
|
125
|
+
Return the value for `key` if `key` has the value in the context object.
|
|
126
|
+
|
|
127
|
+
If `key` does not exist, return `default`. If `default` is not given,
|
|
128
|
+
return None.
|
|
129
|
+
"""
|
|
130
|
+
...
|
|
58
131
|
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
|
|
59
|
-
def copy(self) -> Context:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def
|
|
63
|
-
|
|
132
|
+
def copy(self) -> Context:
|
|
133
|
+
"""Return a shallow copy of the context object."""
|
|
134
|
+
...
|
|
135
|
+
def __getitem__(self, key: ContextVar[_T], /) -> _T:
|
|
136
|
+
"""Return self[key]."""
|
|
137
|
+
...
|
|
138
|
+
def __iter__(self) -> Iterator[ContextVar[Any]]:
|
|
139
|
+
"""Implement iter(self)."""
|
|
140
|
+
...
|
|
141
|
+
def __len__(self) -> int:
|
|
142
|
+
"""Return len(self)."""
|
|
143
|
+
...
|
|
144
|
+
def __eq__(self, value: object, /) -> bool:
|
|
145
|
+
"""Return self==value."""
|
|
146
|
+
...
|
|
@@ -111,7 +111,13 @@ class DictReader(Iterator[dict[_T | Any, str | Any]], Generic[_T]):
|
|
|
111
111
|
def __iter__(self) -> Self: ...
|
|
112
112
|
def __next__(self) -> dict[_T | Any, str | Any]: ...
|
|
113
113
|
if sys.version_info >= (3, 12):
|
|
114
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
114
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
115
|
+
"""
|
|
116
|
+
Represent a PEP 585 generic type
|
|
117
|
+
|
|
118
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
119
|
+
"""
|
|
120
|
+
...
|
|
115
121
|
|
|
116
122
|
class DictWriter(Generic[_T]):
|
|
117
123
|
fieldnames: Collection[_T]
|
|
@@ -139,7 +145,13 @@ class DictWriter(Generic[_T]):
|
|
|
139
145
|
def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ...
|
|
140
146
|
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
|
|
141
147
|
if sys.version_info >= (3, 12):
|
|
142
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
148
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
149
|
+
"""
|
|
150
|
+
Represent a PEP 585 generic type
|
|
151
|
+
|
|
152
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
153
|
+
"""
|
|
154
|
+
...
|
|
143
155
|
|
|
144
156
|
class Sniffer:
|
|
145
157
|
preferred: list[str]
|
|
@@ -76,7 +76,13 @@ class LibraryLoader(Generic[_DLLT]):
|
|
|
76
76
|
def __getitem__(self, name: str) -> _DLLT: ...
|
|
77
77
|
def LoadLibrary(self, name: str) -> _DLLT: ...
|
|
78
78
|
if sys.version_info >= (3, 9):
|
|
79
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
79
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
80
|
+
"""
|
|
81
|
+
Represent a PEP 585 generic type
|
|
82
|
+
|
|
83
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
84
|
+
"""
|
|
85
|
+
...
|
|
80
86
|
|
|
81
87
|
cdll: LibraryLoader[CDLL]
|
|
82
88
|
if sys.platform == "win32":
|
|
@@ -11,9 +11,13 @@ if sys.platform == "win32":
|
|
|
11
11
|
# At runtime, the native endianness is an alias for Structure,
|
|
12
12
|
# while the other is a subclass with a metaclass added in.
|
|
13
13
|
class BigEndianStructure(Structure): ...
|
|
14
|
-
class LittleEndianStructure(Structure):
|
|
14
|
+
class LittleEndianStructure(Structure):
|
|
15
|
+
"""Structure base class"""
|
|
16
|
+
...
|
|
15
17
|
|
|
16
18
|
# Same thing for these: one is an alias of Union at runtime
|
|
17
19
|
if sys.version_info >= (3, 11):
|
|
18
20
|
class BigEndianUnion(Union): ...
|
|
19
|
-
class LittleEndianUnion(Union):
|
|
21
|
+
class LittleEndianUnion(Union):
|
|
22
|
+
"""Union base class"""
|
|
23
|
+
...
|
|
@@ -16,7 +16,19 @@ class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the s
|
|
|
16
16
|
def userptr(self) -> object: ...
|
|
17
17
|
def window(self) -> _CursesWindow: ...
|
|
18
18
|
|
|
19
|
-
def bottom_panel() -> _Curses_Panel:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def
|
|
19
|
+
def bottom_panel() -> _Curses_Panel:
|
|
20
|
+
"""Return the bottom panel in the panel stack."""
|
|
21
|
+
...
|
|
22
|
+
def new_panel(win: _CursesWindow, /) -> _Curses_Panel:
|
|
23
|
+
"""Return a panel object, associating it with the given window win."""
|
|
24
|
+
...
|
|
25
|
+
def top_panel() -> _Curses_Panel:
|
|
26
|
+
"""Return the top panel in the panel stack."""
|
|
27
|
+
...
|
|
28
|
+
def update_panels() -> _Curses_Panel:
|
|
29
|
+
"""
|
|
30
|
+
Updates the virtual screen after changes in the panel stack.
|
|
31
|
+
|
|
32
|
+
This does not call curses.doupdate(), so you'll have to do this yourself.
|
|
33
|
+
"""
|
|
34
|
+
...
|
|
@@ -143,7 +143,13 @@ class Field(Generic[_T]):
|
|
|
143
143
|
|
|
144
144
|
def __set_name__(self, owner: Type[Any], name: str) -> None: ...
|
|
145
145
|
if sys.version_info >= (3, 9):
|
|
146
|
-
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
146
|
+
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
|
|
147
|
+
"""
|
|
148
|
+
Represent a PEP 585 generic type
|
|
149
|
+
|
|
150
|
+
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
|
151
|
+
"""
|
|
152
|
+
...
|
|
147
153
|
|
|
148
154
|
# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers
|
|
149
155
|
# to understand the magic that happens at runtime.
|