basedpyright 1.13.1 → 1.13.2
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 +3 -1
- package/dist/typeshed-fallback/stdlib/_ast.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
- package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
- package/dist/typeshed-fallback/stdlib/_curses.pyi +1 -2
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/_interpchannels.pyi +84 -0
- package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +7 -0
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +3 -2
- package/dist/typeshed-fallback/stdlib/argparse.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
- package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +56 -37
- package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +4 -1
- package/dist/typeshed-fallback/stdlib/asyncio/unix_events.pyi +156 -134
- package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +3 -2
- package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
- package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
- package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/dataclasses.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +2 -5
- package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
- package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -154
- package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +10 -6
- package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +33 -12
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/posixpath.pyi +3 -13
- package/dist/typeshed-fallback/stdlib/spwd.pyi +9 -0
- package/dist/typeshed-fallback/stdlib/subprocess.pyi +8 -0
- package/dist/typeshed-fallback/stdlib/tarfile.pyi +23 -1
- package/dist/typeshed-fallback/stdlib/telnetlib.pyi +1 -0
- package/dist/typeshed-fallback/stdlib/typing.pyi +21 -2
- package/dist/typeshed-fallback/stdlib/weakref.pyi +4 -1
- package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
- package/dist/typeshed-fallback/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +4 -4
- package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +6 -20
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +2 -0
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +5 -3
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/__init__.pyi +143 -79
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +5 -5
- package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +7 -1
- package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +8 -0
- package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +2 -2
- package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +3 -2
- package/dist/typeshed-fallback/stubs/docker/docker/api/network.pyi +32 -15
- package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +36 -7
- package/dist/typeshed-fallback/stubs/docker/docker/models/images.pyi +67 -5
- package/dist/typeshed-fallback/stubs/docker/docker/models/networks.pyi +20 -3
- package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +78 -70
- package/dist/typeshed-fallback/stubs/docker/docker/utils/json_stream.pyi +4 -7
- package/dist/typeshed-fallback/stubs/flake8/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +16 -5
- package/dist/typeshed-fallback/stubs/fpdf2/fpdf/image_datastructures.pyi +2 -1
- package/dist/typeshed-fallback/stubs/fpdf2/fpdf/table.pyi +4 -2
- package/dist/typeshed-fallback/stubs/fpdf2/fpdf/text_region.pyi +7 -7
- package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +1 -0
- package/dist/typeshed-fallback/stubs/hvac/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/raft.pyi +9 -0
- package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/wrapping.pyi +1 -0
- package/dist/typeshed-fallback/stubs/influxdb-client/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_pages.pyi +37 -0
- package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi +5 -1
- package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi +4 -3
- package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi +6 -6
- package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi +6 -6
- package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +3 -1
- package/dist/typeshed-fallback/stubs/olefile/olefile/olefile.pyi +41 -31
- package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/rich_text.pyi +3 -0
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +1 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/container.pyi +18 -0
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +20 -12
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +6 -11
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +66 -135
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +0 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +0 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +3 -3
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +5 -10
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +11 -3
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +6 -3
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +26 -22
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +3 -5
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +5 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +4 -2
- package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +6 -1
- package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
- package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +84 -15
- package/dist/typeshed-fallback/stubs/psutil/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_common.pyi +0 -2
- package/dist/typeshed-fallback/stubs/psutil/psutil/_compat.pyi +0 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +2 -2
- package/dist/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi +1 -1
- package/dist/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pyinstaller/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi +1 -0
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +0 -2
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi +2 -3
- package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +3 -2
- package/dist/typeshed-fallback/stubs/requests/requests/models.pyi +2 -2
- package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +2 -1
- package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +80 -50
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +2 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +6 -3
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +3 -9
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +61 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +12 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +4 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +3 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/compat/py311.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +0 -1
- package/dist/typeshed-fallback/stubs/shapely/METADATA.toml +2 -1
- package/dist/typeshed-fallback/stubs/shapely/shapely/_geometry.pyi +3 -3
- package/dist/typeshed-fallback/stubs/shapely/shapely/constructive.pyi +6 -6
- package/dist/typeshed-fallback/stubs/shapely/shapely/geometry/base.pyi +3 -3
- package/dist/typeshed-fallback/stubs/shapely/shapely/io.pyi +2 -2
- package/dist/typeshed-fallback/stubs/shapely/shapely/strtree.pyi +9 -9
- package/dist/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml +1 -1
- package/package.json +1 -1
- package/dist/typeshed-fallback/stubs/tree-sitter/METADATA.toml +0 -7
- package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi +0 -17
- package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi +0 -115
|
@@ -1,154 +1,160 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
from _typeshed import ReadableBuffer, Unused
|
|
3
|
-
from collections.abc import Iterable, Iterator, Sized
|
|
4
|
-
from typing import NoReturn, overload
|
|
5
|
-
from typing_extensions import Self
|
|
6
|
-
|
|
7
|
-
ACCESS_DEFAULT: int
|
|
8
|
-
ACCESS_READ: int
|
|
9
|
-
ACCESS_WRITE: int
|
|
10
|
-
ACCESS_COPY: int
|
|
11
|
-
|
|
12
|
-
ALLOCATIONGRANULARITY: int
|
|
13
|
-
|
|
14
|
-
if sys.platform == "linux":
|
|
15
|
-
MAP_DENYWRITE: int
|
|
16
|
-
MAP_EXECUTABLE: int
|
|
17
|
-
if sys.version_info >= (3, 10):
|
|
18
|
-
MAP_POPULATE: int
|
|
19
|
-
if sys.version_info >= (3, 11) and sys.platform != "win32" and sys.platform != "darwin":
|
|
20
|
-
MAP_STACK: int
|
|
21
|
-
|
|
22
|
-
if sys.platform != "win32":
|
|
23
|
-
MAP_ANON: int
|
|
24
|
-
MAP_ANONYMOUS: int
|
|
25
|
-
MAP_PRIVATE: int
|
|
26
|
-
MAP_SHARED: int
|
|
27
|
-
PROT_EXEC: int
|
|
28
|
-
PROT_READ: int
|
|
29
|
-
PROT_WRITE: int
|
|
30
|
-
|
|
31
|
-
PAGESIZE: int
|
|
32
|
-
|
|
33
|
-
class mmap(Iterable[int], Sized):
|
|
34
|
-
"""
|
|
35
|
-
Windows: mmap(fileno, length[, tagname[, access[, offset]]])
|
|
36
|
-
|
|
37
|
-
Maps length bytes from the file specified by the file handle fileno,
|
|
38
|
-
and returns a mmap object. If length is larger than the current size
|
|
39
|
-
of the file, the file is extended to contain length bytes. If length
|
|
40
|
-
is 0, the maximum length of the map is the current size of the file,
|
|
41
|
-
except that if the file is empty Windows raises an exception (you cannot
|
|
42
|
-
create an empty mapping on Windows).
|
|
43
|
-
|
|
44
|
-
Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
|
|
45
|
-
|
|
46
|
-
Maps length bytes from the file specified by the file descriptor fileno,
|
|
47
|
-
and returns a mmap object. If length is 0, the maximum length of the map
|
|
48
|
-
will be the current size of the file when mmap is called.
|
|
49
|
-
flags specifies the nature of the mapping. MAP_PRIVATE creates a
|
|
50
|
-
private copy-on-write mapping, so changes to the contents of the mmap
|
|
51
|
-
object will be private to this process, and MAP_SHARED creates a mapping
|
|
52
|
-
that's shared with all other processes mapping the same areas of the file.
|
|
53
|
-
The default value is MAP_SHARED.
|
|
54
|
-
|
|
55
|
-
To map anonymous memory, pass -1 as the fileno (both versions).
|
|
56
|
-
"""
|
|
57
|
-
if sys.platform == "win32":
|
|
58
|
-
def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ...
|
|
59
|
-
else:
|
|
60
|
-
def __init__(
|
|
61
|
-
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
|
|
62
|
-
) -> None: ...
|
|
63
|
-
|
|
64
|
-
def close(self) -> None: ...
|
|
65
|
-
def flush(self, offset: int = ..., size: int = ...) -> None: ...
|
|
66
|
-
def move(self, dest: int, src: int, count: int) -> None: ...
|
|
67
|
-
def read_byte(self) -> int: ...
|
|
68
|
-
def readline(self) -> bytes: ...
|
|
69
|
-
def resize(self, newsize: int) -> None: ...
|
|
70
|
-
def seek(self, pos: int, whence: int = ...) -> None: ...
|
|
71
|
-
def size(self) -> int: ...
|
|
72
|
-
def tell(self) -> int: ...
|
|
73
|
-
def write_byte(self, byte: int) -> None: ...
|
|
74
|
-
def __len__(self) -> int:
|
|
75
|
-
"""Return len(self)."""
|
|
76
|
-
...
|
|
77
|
-
closed: bool
|
|
78
|
-
if sys.platform != "win32":
|
|
79
|
-
def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ...
|
|
80
|
-
|
|
81
|
-
def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
|
82
|
-
def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
|
83
|
-
def read(self, n: int | None = ...) -> bytes: ...
|
|
84
|
-
def write(self, bytes: ReadableBuffer) -> int: ...
|
|
85
|
-
@overload
|
|
86
|
-
def __getitem__(self, key: int, /) -> int:
|
|
87
|
-
"""Return self[key]."""
|
|
88
|
-
...
|
|
89
|
-
@overload
|
|
90
|
-
def __getitem__(self, key: slice, /) -> bytes:
|
|
91
|
-
"""Return self[key]."""
|
|
92
|
-
...
|
|
93
|
-
def __delitem__(self, key: int | slice, /) -> NoReturn:
|
|
94
|
-
"""Delete self[key]."""
|
|
95
|
-
...
|
|
96
|
-
@overload
|
|
97
|
-
def __setitem__(self, key: int, value: int, /) -> None:
|
|
98
|
-
"""Set self[key] to value."""
|
|
99
|
-
...
|
|
100
|
-
@overload
|
|
101
|
-
def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None:
|
|
102
|
-
"""Set self[key] to value."""
|
|
103
|
-
...
|
|
104
|
-
# Doesn't actually exist, but the object actually supports "in" because it has __getitem__,
|
|
105
|
-
# so we claim that there is also a __contains__ to help type checkers.
|
|
106
|
-
def __contains__(self, o: object, /) -> bool: ...
|
|
107
|
-
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__,
|
|
108
|
-
# so we claim that there is also an __iter__ to help type checkers.
|
|
109
|
-
def __iter__(self) -> Iterator[int]: ...
|
|
110
|
-
def __enter__(self) -> Self: ...
|
|
111
|
-
def __exit__(self, *args: Unused) -> None: ...
|
|
112
|
-
def __buffer__(self, flags: int, /) -> memoryview:
|
|
113
|
-
"""Return a buffer object that exposes the underlying memory of the object."""
|
|
114
|
-
...
|
|
115
|
-
def __release_buffer__(self, buffer: memoryview, /) -> None:
|
|
116
|
-
"""Release the buffer object that exposes the underlying memory of the object."""
|
|
117
|
-
...
|
|
118
|
-
if sys.version_info >= (3, 13):
|
|
119
|
-
def seekable(self) -> bool: ...
|
|
120
|
-
|
|
121
|
-
if sys.platform != "win32":
|
|
122
|
-
MADV_NORMAL: int
|
|
123
|
-
MADV_RANDOM: int
|
|
124
|
-
MADV_SEQUENTIAL: int
|
|
125
|
-
MADV_WILLNEED: int
|
|
126
|
-
MADV_DONTNEED: int
|
|
127
|
-
MADV_FREE: int
|
|
128
|
-
|
|
129
|
-
if sys.platform == "linux":
|
|
130
|
-
MADV_REMOVE: int
|
|
131
|
-
MADV_DONTFORK: int
|
|
132
|
-
MADV_DOFORK: int
|
|
133
|
-
MADV_HWPOISON: int
|
|
134
|
-
MADV_MERGEABLE: int
|
|
135
|
-
MADV_UNMERGEABLE: int
|
|
136
|
-
# Seems like this constant is not defined in glibc.
|
|
137
|
-
# See https://github.com/python/typeshed/pull/5360 for details
|
|
138
|
-
# MADV_SOFT_OFFLINE: int
|
|
139
|
-
MADV_HUGEPAGE: int
|
|
140
|
-
MADV_NOHUGEPAGE: int
|
|
141
|
-
MADV_DONTDUMP: int
|
|
142
|
-
MADV_DODUMP: int
|
|
143
|
-
|
|
144
|
-
# This Values are defined for FreeBSD but type checkers do not support conditions for these
|
|
145
|
-
if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32":
|
|
146
|
-
MADV_NOSYNC: int
|
|
147
|
-
MADV_AUTOSYNC: int
|
|
148
|
-
MADV_NOCORE: int
|
|
149
|
-
MADV_CORE: int
|
|
150
|
-
MADV_PROTECT: int
|
|
151
|
-
|
|
152
|
-
if sys.version_info >= (3, 10) and sys.platform == "darwin":
|
|
153
|
-
MADV_FREE_REUSABLE: int
|
|
154
|
-
MADV_FREE_REUSE: int
|
|
1
|
+
import sys
|
|
2
|
+
from _typeshed import ReadableBuffer, Unused
|
|
3
|
+
from collections.abc import Iterable, Iterator, Sized
|
|
4
|
+
from typing import Final, NoReturn, overload
|
|
5
|
+
from typing_extensions import Self
|
|
6
|
+
|
|
7
|
+
ACCESS_DEFAULT: int
|
|
8
|
+
ACCESS_READ: int
|
|
9
|
+
ACCESS_WRITE: int
|
|
10
|
+
ACCESS_COPY: int
|
|
11
|
+
|
|
12
|
+
ALLOCATIONGRANULARITY: int
|
|
13
|
+
|
|
14
|
+
if sys.platform == "linux":
|
|
15
|
+
MAP_DENYWRITE: int
|
|
16
|
+
MAP_EXECUTABLE: int
|
|
17
|
+
if sys.version_info >= (3, 10):
|
|
18
|
+
MAP_POPULATE: int
|
|
19
|
+
if sys.version_info >= (3, 11) and sys.platform != "win32" and sys.platform != "darwin":
|
|
20
|
+
MAP_STACK: int
|
|
21
|
+
|
|
22
|
+
if sys.platform != "win32":
|
|
23
|
+
MAP_ANON: int
|
|
24
|
+
MAP_ANONYMOUS: int
|
|
25
|
+
MAP_PRIVATE: int
|
|
26
|
+
MAP_SHARED: int
|
|
27
|
+
PROT_EXEC: int
|
|
28
|
+
PROT_READ: int
|
|
29
|
+
PROT_WRITE: int
|
|
30
|
+
|
|
31
|
+
PAGESIZE: int
|
|
32
|
+
|
|
33
|
+
class mmap(Iterable[int], Sized):
|
|
34
|
+
"""
|
|
35
|
+
Windows: mmap(fileno, length[, tagname[, access[, offset]]])
|
|
36
|
+
|
|
37
|
+
Maps length bytes from the file specified by the file handle fileno,
|
|
38
|
+
and returns a mmap object. If length is larger than the current size
|
|
39
|
+
of the file, the file is extended to contain length bytes. If length
|
|
40
|
+
is 0, the maximum length of the map is the current size of the file,
|
|
41
|
+
except that if the file is empty Windows raises an exception (you cannot
|
|
42
|
+
create an empty mapping on Windows).
|
|
43
|
+
|
|
44
|
+
Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])
|
|
45
|
+
|
|
46
|
+
Maps length bytes from the file specified by the file descriptor fileno,
|
|
47
|
+
and returns a mmap object. If length is 0, the maximum length of the map
|
|
48
|
+
will be the current size of the file when mmap is called.
|
|
49
|
+
flags specifies the nature of the mapping. MAP_PRIVATE creates a
|
|
50
|
+
private copy-on-write mapping, so changes to the contents of the mmap
|
|
51
|
+
object will be private to this process, and MAP_SHARED creates a mapping
|
|
52
|
+
that's shared with all other processes mapping the same areas of the file.
|
|
53
|
+
The default value is MAP_SHARED.
|
|
54
|
+
|
|
55
|
+
To map anonymous memory, pass -1 as the fileno (both versions).
|
|
56
|
+
"""
|
|
57
|
+
if sys.platform == "win32":
|
|
58
|
+
def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ...
|
|
59
|
+
else:
|
|
60
|
+
def __init__(
|
|
61
|
+
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
|
|
62
|
+
) -> None: ...
|
|
63
|
+
|
|
64
|
+
def close(self) -> None: ...
|
|
65
|
+
def flush(self, offset: int = ..., size: int = ...) -> None: ...
|
|
66
|
+
def move(self, dest: int, src: int, count: int) -> None: ...
|
|
67
|
+
def read_byte(self) -> int: ...
|
|
68
|
+
def readline(self) -> bytes: ...
|
|
69
|
+
def resize(self, newsize: int) -> None: ...
|
|
70
|
+
def seek(self, pos: int, whence: int = ...) -> None: ...
|
|
71
|
+
def size(self) -> int: ...
|
|
72
|
+
def tell(self) -> int: ...
|
|
73
|
+
def write_byte(self, byte: int) -> None: ...
|
|
74
|
+
def __len__(self) -> int:
|
|
75
|
+
"""Return len(self)."""
|
|
76
|
+
...
|
|
77
|
+
closed: bool
|
|
78
|
+
if sys.platform != "win32":
|
|
79
|
+
def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ...
|
|
80
|
+
|
|
81
|
+
def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
|
82
|
+
def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
|
83
|
+
def read(self, n: int | None = ...) -> bytes: ...
|
|
84
|
+
def write(self, bytes: ReadableBuffer) -> int: ...
|
|
85
|
+
@overload
|
|
86
|
+
def __getitem__(self, key: int, /) -> int:
|
|
87
|
+
"""Return self[key]."""
|
|
88
|
+
...
|
|
89
|
+
@overload
|
|
90
|
+
def __getitem__(self, key: slice, /) -> bytes:
|
|
91
|
+
"""Return self[key]."""
|
|
92
|
+
...
|
|
93
|
+
def __delitem__(self, key: int | slice, /) -> NoReturn:
|
|
94
|
+
"""Delete self[key]."""
|
|
95
|
+
...
|
|
96
|
+
@overload
|
|
97
|
+
def __setitem__(self, key: int, value: int, /) -> None:
|
|
98
|
+
"""Set self[key] to value."""
|
|
99
|
+
...
|
|
100
|
+
@overload
|
|
101
|
+
def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None:
|
|
102
|
+
"""Set self[key] to value."""
|
|
103
|
+
...
|
|
104
|
+
# Doesn't actually exist, but the object actually supports "in" because it has __getitem__,
|
|
105
|
+
# so we claim that there is also a __contains__ to help type checkers.
|
|
106
|
+
def __contains__(self, o: object, /) -> bool: ...
|
|
107
|
+
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__,
|
|
108
|
+
# so we claim that there is also an __iter__ to help type checkers.
|
|
109
|
+
def __iter__(self) -> Iterator[int]: ...
|
|
110
|
+
def __enter__(self) -> Self: ...
|
|
111
|
+
def __exit__(self, *args: Unused) -> None: ...
|
|
112
|
+
def __buffer__(self, flags: int, /) -> memoryview:
|
|
113
|
+
"""Return a buffer object that exposes the underlying memory of the object."""
|
|
114
|
+
...
|
|
115
|
+
def __release_buffer__(self, buffer: memoryview, /) -> None:
|
|
116
|
+
"""Release the buffer object that exposes the underlying memory of the object."""
|
|
117
|
+
...
|
|
118
|
+
if sys.version_info >= (3, 13):
|
|
119
|
+
def seekable(self) -> bool: ...
|
|
120
|
+
|
|
121
|
+
if sys.platform != "win32":
|
|
122
|
+
MADV_NORMAL: int
|
|
123
|
+
MADV_RANDOM: int
|
|
124
|
+
MADV_SEQUENTIAL: int
|
|
125
|
+
MADV_WILLNEED: int
|
|
126
|
+
MADV_DONTNEED: int
|
|
127
|
+
MADV_FREE: int
|
|
128
|
+
|
|
129
|
+
if sys.platform == "linux":
|
|
130
|
+
MADV_REMOVE: int
|
|
131
|
+
MADV_DONTFORK: int
|
|
132
|
+
MADV_DOFORK: int
|
|
133
|
+
MADV_HWPOISON: int
|
|
134
|
+
MADV_MERGEABLE: int
|
|
135
|
+
MADV_UNMERGEABLE: int
|
|
136
|
+
# Seems like this constant is not defined in glibc.
|
|
137
|
+
# See https://github.com/python/typeshed/pull/5360 for details
|
|
138
|
+
# MADV_SOFT_OFFLINE: int
|
|
139
|
+
MADV_HUGEPAGE: int
|
|
140
|
+
MADV_NOHUGEPAGE: int
|
|
141
|
+
MADV_DONTDUMP: int
|
|
142
|
+
MADV_DODUMP: int
|
|
143
|
+
|
|
144
|
+
# This Values are defined for FreeBSD but type checkers do not support conditions for these
|
|
145
|
+
if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32":
|
|
146
|
+
MADV_NOSYNC: int
|
|
147
|
+
MADV_AUTOSYNC: int
|
|
148
|
+
MADV_NOCORE: int
|
|
149
|
+
MADV_CORE: int
|
|
150
|
+
MADV_PROTECT: int
|
|
151
|
+
|
|
152
|
+
if sys.version_info >= (3, 10) and sys.platform == "darwin":
|
|
153
|
+
MADV_FREE_REUSABLE: int
|
|
154
|
+
MADV_FREE_REUSE: int
|
|
155
|
+
|
|
156
|
+
if sys.version_info >= (3, 13) and sys.platform != "win32":
|
|
157
|
+
MAP_32BIT: Final = 32768
|
|
158
|
+
|
|
159
|
+
if sys.version_info >= (3, 13) and sys.platform == "darwin":
|
|
160
|
+
MAP_TPRO: Final = 524288
|
|
@@ -93,16 +93,20 @@ class BaseContext:
|
|
|
93
93
|
def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ...
|
|
94
94
|
@overload
|
|
95
95
|
def Array(
|
|
96
|
-
self, typecode_or_type: type[
|
|
97
|
-
) ->
|
|
96
|
+
self, typecode_or_type: type[_SimpleCData[_T]], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]
|
|
97
|
+
) -> SynchronizedArray[_T]: ...
|
|
98
98
|
@overload
|
|
99
99
|
def Array(
|
|
100
|
-
self, typecode_or_type: type[
|
|
101
|
-
) ->
|
|
100
|
+
self, typecode_or_type: type[c_char], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
|
101
|
+
) -> SynchronizedString: ...
|
|
102
102
|
@overload
|
|
103
103
|
def Array(
|
|
104
|
-
self,
|
|
105
|
-
|
|
104
|
+
self,
|
|
105
|
+
typecode_or_type: type[_SimpleCData[_T]],
|
|
106
|
+
size_or_initializer: int | Sequence[Any],
|
|
107
|
+
*,
|
|
108
|
+
lock: Literal[True] | _LockLike = True,
|
|
109
|
+
) -> SynchronizedArray[_T]: ...
|
|
106
110
|
@overload
|
|
107
111
|
def Array(
|
|
108
112
|
self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
|
@@ -39,12 +39,20 @@ def Array(
|
|
|
39
39
|
) -> _CT: ...
|
|
40
40
|
@overload
|
|
41
41
|
def Array(
|
|
42
|
-
typecode_or_type: type[
|
|
42
|
+
typecode_or_type: type[c_char],
|
|
43
43
|
size_or_initializer: int | Sequence[Any],
|
|
44
44
|
*,
|
|
45
45
|
lock: Literal[True] | _LockLike = True,
|
|
46
46
|
ctx: BaseContext | None = None,
|
|
47
|
-
) ->
|
|
47
|
+
) -> SynchronizedString: ...
|
|
48
|
+
@overload
|
|
49
|
+
def Array(
|
|
50
|
+
typecode_or_type: type[_SimpleCData[_T]],
|
|
51
|
+
size_or_initializer: int | Sequence[Any],
|
|
52
|
+
*,
|
|
53
|
+
lock: Literal[True] | _LockLike = True,
|
|
54
|
+
ctx: BaseContext | None = None,
|
|
55
|
+
) -> SynchronizedArray[_T]: ...
|
|
48
56
|
@overload
|
|
49
57
|
def Array(
|
|
50
58
|
typecode_or_type: str,
|
|
@@ -65,9 +73,11 @@ def copy(obj: _CT) -> _CT: ...
|
|
|
65
73
|
@overload
|
|
66
74
|
def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ...
|
|
67
75
|
@overload
|
|
68
|
-
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ...
|
|
76
|
+
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... # type: ignore
|
|
69
77
|
@overload
|
|
70
|
-
def synchronized(
|
|
78
|
+
def synchronized(
|
|
79
|
+
obj: ctypes.Array[_SimpleCData[_T]], lock: _LockLike | None = None, ctx: Any | None = None
|
|
80
|
+
) -> SynchronizedArray[_T]: ...
|
|
71
81
|
@overload
|
|
72
82
|
def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ...
|
|
73
83
|
|
|
@@ -89,19 +99,30 @@ class SynchronizedBase(Generic[_CT]):
|
|
|
89
99
|
class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]):
|
|
90
100
|
value: _T
|
|
91
101
|
|
|
92
|
-
class SynchronizedArray(SynchronizedBase[ctypes.Array[
|
|
102
|
+
class SynchronizedArray(SynchronizedBase[ctypes.Array[_SimpleCData[_T]]], Generic[_T]):
|
|
93
103
|
def __len__(self) -> int: ...
|
|
94
104
|
@overload
|
|
95
|
-
def __getitem__(self, i: slice) -> list[
|
|
105
|
+
def __getitem__(self, i: slice) -> list[_T]: ...
|
|
96
106
|
@overload
|
|
97
|
-
def __getitem__(self, i: int) ->
|
|
107
|
+
def __getitem__(self, i: int) -> _T: ...
|
|
98
108
|
@overload
|
|
99
|
-
def __setitem__(self, i: slice, value: Iterable[
|
|
109
|
+
def __setitem__(self, i: slice, value: Iterable[_T]) -> None: ...
|
|
100
110
|
@overload
|
|
101
|
-
def __setitem__(self, i: int, value:
|
|
102
|
-
def __getslice__(self, start: int, stop: int) -> list[
|
|
103
|
-
def __setslice__(self, start: int, stop: int, values: Iterable[
|
|
111
|
+
def __setitem__(self, i: int, value: _T) -> None: ...
|
|
112
|
+
def __getslice__(self, start: int, stop: int) -> list[_T]: ...
|
|
113
|
+
def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ...
|
|
114
|
+
|
|
115
|
+
class SynchronizedString(SynchronizedArray[bytes]):
|
|
116
|
+
@overload # type: ignore[override]
|
|
117
|
+
def __getitem__(self, i: slice) -> bytes: ...
|
|
118
|
+
@overload # type: ignore[override]
|
|
119
|
+
def __getitem__(self, i: int) -> bytes: ...
|
|
120
|
+
@overload # type: ignore[override]
|
|
121
|
+
def __setitem__(self, i: slice, value: bytes) -> None: ...
|
|
122
|
+
@overload # type: ignore[override]
|
|
123
|
+
def __setitem__(self, i: int, value: bytes) -> None: ... # type: ignore[override]
|
|
124
|
+
def __getslice__(self, start: int, stop: int) -> bytes: ... # type: ignore[override]
|
|
125
|
+
def __setslice__(self, start: int, stop: int, values: bytes) -> None: ... # type: ignore[override]
|
|
104
126
|
|
|
105
|
-
class SynchronizedString(SynchronizedArray[c_char]):
|
|
106
127
|
value: bytes
|
|
107
128
|
raw: bytes
|
|
@@ -914,8 +914,8 @@ if sys.platform != "win32":
|
|
|
914
914
|
def forkpty() -> tuple[int, int]: ... # some flavors of Unix
|
|
915
915
|
def killpg(pgid: int, signal: int, /) -> None: ...
|
|
916
916
|
def nice(increment: int, /) -> int: ...
|
|
917
|
-
if sys.platform != "darwin":
|
|
918
|
-
def plock(op: int, /) -> None: ...
|
|
917
|
+
if sys.platform != "darwin" and sys.platform != "linux":
|
|
918
|
+
def plock(op: int, /) -> None: ...
|
|
919
919
|
|
|
920
920
|
class _wrap_close(_TextIOWrapper):
|
|
921
921
|
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
|
|
@@ -1141,16 +1141,16 @@ if sys.version_info >= (3, 10) and sys.platform == "linux":
|
|
|
1141
1141
|
if sys.version_info >= (3, 12) and sys.platform == "linux":
|
|
1142
1142
|
CLONE_FILES: int
|
|
1143
1143
|
CLONE_FS: int
|
|
1144
|
-
CLONE_NEWCGROUP: int
|
|
1145
|
-
CLONE_NEWIPC: int
|
|
1146
|
-
CLONE_NEWNET: int
|
|
1144
|
+
CLONE_NEWCGROUP: int # Linux 4.6+
|
|
1145
|
+
CLONE_NEWIPC: int # Linux 2.6.19+
|
|
1146
|
+
CLONE_NEWNET: int # Linux 2.6.24+
|
|
1147
1147
|
CLONE_NEWNS: int
|
|
1148
|
-
CLONE_NEWPID: int
|
|
1149
|
-
CLONE_NEWTIME: int
|
|
1150
|
-
CLONE_NEWUSER: int
|
|
1151
|
-
CLONE_NEWUTS: int
|
|
1148
|
+
CLONE_NEWPID: int # Linux 3.8+
|
|
1149
|
+
CLONE_NEWTIME: int # Linux 5.6+
|
|
1150
|
+
CLONE_NEWUSER: int # Linux 3.8+
|
|
1151
|
+
CLONE_NEWUTS: int # Linux 2.6.19+
|
|
1152
1152
|
CLONE_SIGHAND: int
|
|
1153
|
-
CLONE_SYSVSEM: int
|
|
1153
|
+
CLONE_SYSVSEM: int # Linux 2.6.26+
|
|
1154
1154
|
CLONE_THREAD: int
|
|
1155
1155
|
CLONE_VM: int
|
|
1156
1156
|
def unshare(flags: int) -> None: ...
|
|
@@ -77,11 +77,7 @@ pathsep: LiteralString
|
|
|
77
77
|
defpath: LiteralString
|
|
78
78
|
devnull: LiteralString
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
@overload
|
|
82
|
-
def abspath(path: PathLike[AnyStr]) -> AnyStr: ...
|
|
83
|
-
@overload
|
|
84
|
-
def abspath(path: AnyStr) -> AnyStr: ...
|
|
80
|
+
def abspath(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
|
85
81
|
@overload
|
|
86
82
|
def basename(p: PathLike[AnyStr]) -> AnyStr: ...
|
|
87
83
|
@overload
|
|
@@ -90,14 +86,8 @@ def basename(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
|
|
90
86
|
def dirname(p: PathLike[AnyStr]) -> AnyStr: ...
|
|
91
87
|
@overload
|
|
92
88
|
def dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
|
93
|
-
|
|
94
|
-
def
|
|
95
|
-
@overload
|
|
96
|
-
def expanduser(path: AnyStr) -> AnyStr: ...
|
|
97
|
-
@overload
|
|
98
|
-
def expandvars(path: PathLike[AnyStr]) -> AnyStr: ...
|
|
99
|
-
@overload
|
|
100
|
-
def expandvars(path: AnyStr) -> AnyStr: ...
|
|
89
|
+
def expanduser(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
|
90
|
+
def expandvars(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
|
101
91
|
@overload
|
|
102
92
|
def normcase(s: PathLike[AnyStr]) -> AnyStr: ...
|
|
103
93
|
@overload
|
|
@@ -73,6 +73,15 @@ if sys.platform != "win32":
|
|
|
73
73
|
def sp_flag(self) -> int:
|
|
74
74
|
"""reserved"""
|
|
75
75
|
...
|
|
76
|
+
# Deprecated aliases below.
|
|
77
|
+
@property
|
|
78
|
+
def sp_nam(self) -> str:
|
|
79
|
+
"""login name; deprecated"""
|
|
80
|
+
...
|
|
81
|
+
@property
|
|
82
|
+
def sp_pwd(self) -> str:
|
|
83
|
+
"""encrypted password; deprecated"""
|
|
84
|
+
...
|
|
76
85
|
|
|
77
86
|
def getspall() -> list[struct_spwd]:
|
|
78
87
|
"""
|
|
@@ -889,6 +889,7 @@ if sys.version_info >= (3, 11):
|
|
|
889
889
|
start_new_session: bool = False,
|
|
890
890
|
pass_fds: Collection[int] = ...,
|
|
891
891
|
*,
|
|
892
|
+
encoding: str | None = None,
|
|
892
893
|
timeout: float | None = None,
|
|
893
894
|
text: bool | None = None,
|
|
894
895
|
user: str | int | None = None,
|
|
@@ -920,6 +921,7 @@ elif sys.version_info >= (3, 10):
|
|
|
920
921
|
start_new_session: bool = False,
|
|
921
922
|
pass_fds: Collection[int] = ...,
|
|
922
923
|
*,
|
|
924
|
+
encoding: str | None = None,
|
|
923
925
|
timeout: float | None = None,
|
|
924
926
|
text: bool | None = None,
|
|
925
927
|
user: str | int | None = None,
|
|
@@ -950,6 +952,7 @@ elif sys.version_info >= (3, 9):
|
|
|
950
952
|
start_new_session: bool = False,
|
|
951
953
|
pass_fds: Collection[int] = ...,
|
|
952
954
|
*,
|
|
955
|
+
encoding: str | None = None,
|
|
953
956
|
timeout: float | None = None,
|
|
954
957
|
text: bool | None = None,
|
|
955
958
|
user: str | int | None = None,
|
|
@@ -978,6 +981,7 @@ else:
|
|
|
978
981
|
start_new_session: bool = False,
|
|
979
982
|
pass_fds: Collection[int] = ...,
|
|
980
983
|
*,
|
|
984
|
+
encoding: str | None = None,
|
|
981
985
|
timeout: float | None = None,
|
|
982
986
|
text: bool | None = None,
|
|
983
987
|
) -> int: ...
|
|
@@ -1005,6 +1009,7 @@ if sys.version_info >= (3, 11):
|
|
|
1005
1009
|
pass_fds: Collection[int] = ...,
|
|
1006
1010
|
timeout: float | None = ...,
|
|
1007
1011
|
*,
|
|
1012
|
+
encoding: str | None = None,
|
|
1008
1013
|
text: bool | None = None,
|
|
1009
1014
|
user: str | int | None = None,
|
|
1010
1015
|
group: str | int | None = None,
|
|
@@ -1036,6 +1041,7 @@ elif sys.version_info >= (3, 10):
|
|
|
1036
1041
|
pass_fds: Collection[int] = ...,
|
|
1037
1042
|
timeout: float | None = ...,
|
|
1038
1043
|
*,
|
|
1044
|
+
encoding: str | None = None,
|
|
1039
1045
|
text: bool | None = None,
|
|
1040
1046
|
user: str | int | None = None,
|
|
1041
1047
|
group: str | int | None = None,
|
|
@@ -1066,6 +1072,7 @@ elif sys.version_info >= (3, 9):
|
|
|
1066
1072
|
pass_fds: Collection[int] = ...,
|
|
1067
1073
|
timeout: float | None = ...,
|
|
1068
1074
|
*,
|
|
1075
|
+
encoding: str | None = None,
|
|
1069
1076
|
text: bool | None = None,
|
|
1070
1077
|
user: str | int | None = None,
|
|
1071
1078
|
group: str | int | None = None,
|
|
@@ -1094,6 +1101,7 @@ else:
|
|
|
1094
1101
|
pass_fds: Collection[int] = ...,
|
|
1095
1102
|
timeout: float | None = ...,
|
|
1096
1103
|
*,
|
|
1104
|
+
encoding: str | None = None,
|
|
1097
1105
|
text: bool | None = None,
|
|
1098
1106
|
) -> int: ...
|
|
1099
1107
|
|
|
@@ -103,10 +103,13 @@ PAX_NAME_FIELDS: set[str]
|
|
|
103
103
|
|
|
104
104
|
ENCODING: str
|
|
105
105
|
|
|
106
|
+
_FileCreationModes: TypeAlias = Literal["a", "w", "x"]
|
|
107
|
+
|
|
108
|
+
@overload
|
|
106
109
|
def open(
|
|
107
110
|
name: StrOrBytesPath | None = None,
|
|
108
111
|
mode: str = "r",
|
|
109
|
-
fileobj: IO[bytes] | None = None,
|
|
112
|
+
fileobj: IO[bytes] | None = None,
|
|
110
113
|
bufsize: int = 10240,
|
|
111
114
|
*,
|
|
112
115
|
format: int | None = ...,
|
|
@@ -121,6 +124,25 @@ def open(
|
|
|
121
124
|
compresslevel: int | None = ...,
|
|
122
125
|
preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...,
|
|
123
126
|
) -> TarFile: ...
|
|
127
|
+
@overload
|
|
128
|
+
def open(
|
|
129
|
+
name: StrOrBytesPath | None = None,
|
|
130
|
+
mode: _FileCreationModes = ...,
|
|
131
|
+
fileobj: _Fileobj | None = None,
|
|
132
|
+
bufsize: int = 10240,
|
|
133
|
+
*,
|
|
134
|
+
format: int | None = ...,
|
|
135
|
+
tarinfo: type[TarInfo] | None = ...,
|
|
136
|
+
dereference: bool | None = ...,
|
|
137
|
+
ignore_zeros: bool | None = ...,
|
|
138
|
+
encoding: str | None = ...,
|
|
139
|
+
errors: str = ...,
|
|
140
|
+
pax_headers: Mapping[str, str] | None = ...,
|
|
141
|
+
debug: int | None = ...,
|
|
142
|
+
errorlevel: int | None = ...,
|
|
143
|
+
compresslevel: int | None = ...,
|
|
144
|
+
preset: int | None = ...,
|
|
145
|
+
) -> TarFile: ...
|
|
124
146
|
|
|
125
147
|
class ExFileObject(io.BufferedReader):
|
|
126
148
|
def __init__(self, tarfile: TarFile, tarinfo: TarInfo) -> None: ...
|
|
@@ -88,6 +88,7 @@ NOOPT: bytes
|
|
|
88
88
|
|
|
89
89
|
class Telnet:
|
|
90
90
|
host: str | None # undocumented
|
|
91
|
+
sock: socket.socket | None # undocumented
|
|
91
92
|
def __init__(self, host: str | None = None, port: int = 0, timeout: float = ...) -> None: ...
|
|
92
93
|
def open(self, host: str, port: int = 0, timeout: float = ...) -> None: ...
|
|
93
94
|
def msg(self, msg: str, *args: Any) -> None: ...
|
|
@@ -21,7 +21,7 @@ from types import (
|
|
|
21
21
|
TracebackType,
|
|
22
22
|
WrapperDescriptorType,
|
|
23
23
|
)
|
|
24
|
-
from typing_extensions import Never as _Never, ParamSpec as _ParamSpec
|
|
24
|
+
from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, deprecated
|
|
25
25
|
|
|
26
26
|
if sys.version_info >= (3, 9):
|
|
27
27
|
from types import GenericAlias
|
|
@@ -991,11 +991,30 @@ class ForwardRef:
|
|
|
991
991
|
def __init__(self, arg: str, is_argument: bool = True) -> None: ...
|
|
992
992
|
|
|
993
993
|
if sys.version_info >= (3, 13):
|
|
994
|
+
@overload
|
|
995
|
+
@deprecated(
|
|
996
|
+
"Failing to pass a value to the 'type_params' parameter of ForwardRef._evaluate() is deprecated, "
|
|
997
|
+
"as it leads to incorrect behaviour when evaluating a stringified annotation "
|
|
998
|
+
"that references a PEP 695 type parameter. It will be disallowed in Python 3.15."
|
|
999
|
+
)
|
|
1000
|
+
def _evaluate(
|
|
1001
|
+
self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None, *, recursive_guard: frozenset[str]
|
|
1002
|
+
) -> Any | None: ...
|
|
1003
|
+
@overload
|
|
1004
|
+
def _evaluate(
|
|
1005
|
+
self,
|
|
1006
|
+
globalns: dict[str, Any] | None,
|
|
1007
|
+
localns: dict[str, Any] | None,
|
|
1008
|
+
type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...],
|
|
1009
|
+
*,
|
|
1010
|
+
recursive_guard: frozenset[str],
|
|
1011
|
+
) -> Any | None: ...
|
|
1012
|
+
elif sys.version_info >= (3, 12):
|
|
994
1013
|
def _evaluate(
|
|
995
1014
|
self,
|
|
996
1015
|
globalns: dict[str, Any] | None,
|
|
997
1016
|
localns: dict[str, Any] | None,
|
|
998
|
-
type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] =
|
|
1017
|
+
type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None,
|
|
999
1018
|
*,
|
|
1000
1019
|
recursive_guard: frozenset[str],
|
|
1001
1020
|
) -> Any | None: ...
|