basedpyright 1.31.7 → 1.32.0
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/_csv.pyi +4 -3
- package/dist/typeshed-fallback/stdlib/_frozen_importlib.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_frozen_importlib_external.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi +3 -0
- package/dist/typeshed-fallback/stdlib/ast.pyi +29 -10
- package/dist/typeshed-fallback/stdlib/builtins.pyi +79 -62
- package/dist/typeshed-fallback/stdlib/cmath.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/copy.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/html/parser.pyi +4 -9
- package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/importlib/resources/__init__.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/importlib/resources/_functional.pyi +2 -1
- package/dist/typeshed-fallback/stdlib/operator.pyi +4 -2
- package/dist/typeshed-fallback/stdlib/pdb.pyi +5 -0
- package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +160 -69
- package/dist/typeshed-fallback/stdlib/turtle.pyi +18 -14
- package/dist/typeshed-fallback/stdlib/types.pyi +21 -16
- package/dist/typeshed-fallback/stdlib/typing.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +2 -1
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/xxlimited.pyi +16 -3
- package/dist/typeshed-fallback/stubs/Authlib/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7515/jws.pyi +3 -2
- package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7516/models.pyi +2 -2
- package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7518/jwe_zips.pyi +7 -2
- package/dist/typeshed-fallback/stubs/Authlib/authlib/oauth2/rfc7591/endpoint.pyi +6 -4
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/constants.pyi +22 -0
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi +2 -21
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi +11 -0
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi +22 -3
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pinmux_lookup.pyi +6 -0
- package/dist/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/PySocks/sockshandler.pyi +0 -5
- package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +2 -0
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +1 -1
- package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +15 -4
- package/dist/typeshed-fallback/stubs/braintree/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/braintree/braintree/__init__.pyi +11 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_gateway.pyi +13 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_jwt.pyi +8 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_jwt_request.pyi +18 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi +4 -3
- package/dist/typeshed-fallback/stubs/braintree/braintree/error_codes.pyi +2 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/receiver.pyi +6 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/sender.pyi +6 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/transaction_us_bank_account_request.pyi +17 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/transfer.pyi +4 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/us_bank_account_verification.pyi +1 -0
- package/dist/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi +36 -5
- package/dist/typeshed-fallback/stubs/cachetools/cachetools/func.pyi +45 -10
- package/dist/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi +2 -2
- package/dist/typeshed-fallback/stubs/django-filter/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/django-filter/django_filters/filters.pyi +1 -1
- package/dist/typeshed-fallback/stubs/docker/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +2 -2
- package/dist/typeshed-fallback/stubs/docker/docker/api/swarm.pyi +12 -9
- package/dist/typeshed-fallback/stubs/docker/docker/credentials/store.pyi +3 -3
- package/dist/typeshed-fallback/stubs/docker/docker/errors.pyi +9 -7
- package/dist/typeshed-fallback/stubs/docker/docker/models/services.pyi +4 -6
- package/dist/typeshed-fallback/stubs/docker/docker/transport/npipeconn.pyi +16 -16
- package/dist/typeshed-fallback/stubs/docker/docker/transport/npipesocket.pyi +40 -32
- package/dist/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi +30 -24
- package/dist/typeshed-fallback/stubs/docker/docker/transport/unixconn.pyi +22 -19
- package/dist/typeshed-fallback/stubs/docker/docker/types/networks.pyi +1 -1
- package/dist/typeshed-fallback/stubs/docker/docker/types/services.pyi +16 -10
- package/dist/typeshed-fallback/stubs/docker/docker/types/swarm.pyi +2 -7
- package/dist/typeshed-fallback/stubs/docker/docker/utils/decorators.pyi +8 -4
- package/dist/typeshed-fallback/stubs/docker/docker/utils/utils.pyi +4 -4
- package/dist/typeshed-fallback/stubs/docutils/docutils/nodes.pyi +2 -2
- package/dist/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/grpcio/grpc/__init__.pyi +32 -34
- package/dist/typeshed-fallback/stubs/grpcio/grpc/aio/__init__.pyi +40 -21
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/app/base.pyi +0 -3
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/app/wsgiapp.pyi +0 -4
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi +1 -2
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi +1 -2
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/message.pyi +0 -3
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/unreader.pyi +0 -3
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi +0 -2
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/instrument/statsd.pyi +0 -9
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/reloader.pyi +1 -3
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/sock.pyi +0 -3
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/geventlet.pyi +1 -8
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/ggevent.pyi +0 -9
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gtornado.pyi +1 -4
- package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/sync.pyi +0 -3
- package/dist/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi +5 -5
- package/dist/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi +11 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/quality.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/utils.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/d_separation.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/efficiency_measures.pyi +4 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/utils.pyi +10 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/hierarchy.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/binary.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/product.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/branchings.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/decomposition.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/mst.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/wiener.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi +26 -19
- package/dist/typeshed-fallback/stubs/networkx/networkx/convert_matrix.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/ego.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/geometric.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/line.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/mycielski.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/spectral_graph_forge.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/stochastic.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi +8 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi +9 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/graph6.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi +10 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +22 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/tree.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/p2g.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/sparse6.pyi +3 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/utils/backends.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/utils/misc.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi +2 -2
- package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +11 -4
- package/dist/typeshed-fallback/stubs/psycopg2/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/psycopg2/psycopg2/errorcodes.pyi +3 -0
- package/dist/typeshed-fallback/stubs/pyserial/serial/rfc2217.pyi +2 -2
- package/dist/typeshed-fallback/stubs/pyserial/serial/serialutil.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pyserial/serial/tools/list_ports.pyi +3 -1
- package/dist/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_windows.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_spy.pyi +2 -2
- package/dist/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi +30 -1
- package/dist/typeshed-fallback/stubs/pywin32/win32/win32pipe.pyi +1 -1
- package/dist/typeshed-fallback/stubs/six/six/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stubs/www-authenticate/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/www-authenticate/www_authenticate.pyi +34 -0
- package/dist/typeshed-fallback/stubs/xlrd/xlrd/sheet.pyi +5 -5
- package/dist/typeshed-fallback/stubs/xmldiff/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/__init__.pyi +0 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/actions.pyi +58 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/diff.pyi +36 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/diff_match_patch.pyi +58 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/formatting.pyi +80 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/main.pyi +70 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/patch.pyi +12 -0
- package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/utils.pyi +16 -0
- package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/common.pyi +48 -32
- package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/commonmistakes.pyi +5 -3
- package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/commonprotocols.pyi +5 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a205439338a4ad3debec1eeae7d300e3781c066d
|
|
@@ -129,7 +129,7 @@ else:
|
|
|
129
129
|
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
|
|
130
130
|
|
|
131
131
|
def writer(
|
|
132
|
-
|
|
132
|
+
fileobj: SupportsWrite[str],
|
|
133
133
|
/,
|
|
134
134
|
dialect: _DialectLike = "excel",
|
|
135
135
|
*,
|
|
@@ -158,7 +158,7 @@ def writer(
|
|
|
158
158
|
"""
|
|
159
159
|
...
|
|
160
160
|
def reader(
|
|
161
|
-
|
|
161
|
+
iterable: Iterable[str],
|
|
162
162
|
/,
|
|
163
163
|
dialect: _DialectLike = "excel",
|
|
164
164
|
*,
|
|
@@ -189,7 +189,8 @@ def reader(
|
|
|
189
189
|
...
|
|
190
190
|
def register_dialect(
|
|
191
191
|
name: str,
|
|
192
|
-
|
|
192
|
+
/,
|
|
193
|
+
dialect: type[Dialect | csv.Dialect] | str = "excel",
|
|
193
194
|
*,
|
|
194
195
|
delimiter: str = ",",
|
|
195
196
|
quotechar: str | None = '"',
|
|
@@ -13,7 +13,7 @@ def __import__(
|
|
|
13
13
|
name: str,
|
|
14
14
|
globals: Mapping[str, object] | None = None,
|
|
15
15
|
locals: Mapping[str, object] | None = None,
|
|
16
|
-
fromlist: Sequence[str] = (),
|
|
16
|
+
fromlist: Sequence[str] | None = (),
|
|
17
17
|
level: int = 0,
|
|
18
18
|
) -> ModuleType: ...
|
|
19
19
|
def spec_from_loader(
|
|
@@ -100,7 +100,7 @@ class SourceLoader(_LoaderBasics):
|
|
|
100
100
|
def get_source(self, fullname: str) -> str | None: ...
|
|
101
101
|
def path_stats(self, path: str) -> Mapping[str, Any]: ...
|
|
102
102
|
def source_to_code(
|
|
103
|
-
self, data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path:
|
|
103
|
+
self, data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: bytes | StrPath
|
|
104
104
|
) -> types.CodeType: ...
|
|
105
105
|
def get_code(self, fullname: str) -> types.CodeType | None: ...
|
|
106
106
|
|
|
@@ -109,8 +109,8 @@ class FileLoader:
|
|
|
109
109
|
path: str
|
|
110
110
|
def __init__(self, fullname: str, path: str) -> None: ...
|
|
111
111
|
def get_data(self, path: str) -> bytes: ...
|
|
112
|
-
def get_filename(self,
|
|
113
|
-
def load_module(self,
|
|
112
|
+
def get_filename(self, fullname: str | None = None) -> str: ...
|
|
113
|
+
def load_module(self, fullname: str | None = None) -> types.ModuleType: ...
|
|
114
114
|
if sys.version_info >= (3, 10):
|
|
115
115
|
def get_resource_reader(self, name: str | None = None) -> importlib.readers.FileReader: ...
|
|
116
116
|
else:
|
|
@@ -126,7 +126,7 @@ class SourceFileLoader(importlib.abc.FileLoader, FileLoader, importlib.abc.Sourc
|
|
|
126
126
|
def source_to_code( # type: ignore[override] # incompatible with InspectLoader.source_to_code
|
|
127
127
|
self,
|
|
128
128
|
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive,
|
|
129
|
-
path:
|
|
129
|
+
path: bytes | StrPath,
|
|
130
130
|
*,
|
|
131
131
|
_optimize: int = -1,
|
|
132
132
|
) -> types.CodeType: ...
|
|
@@ -137,7 +137,7 @@ class SourcelessFileLoader(importlib.abc.FileLoader, FileLoader, _LoaderBasics):
|
|
|
137
137
|
|
|
138
138
|
class ExtensionFileLoader(FileLoader, _LoaderBasics, importlib.abc.ExecutionLoader):
|
|
139
139
|
def __init__(self, name: str, path: str) -> None: ...
|
|
140
|
-
def get_filename(self,
|
|
140
|
+
def get_filename(self, fullname: str | None = None) -> str: ...
|
|
141
141
|
def get_source(self, fullname: str) -> None: ...
|
|
142
142
|
def create_module(self, spec: ModuleSpec) -> types.ModuleType: ...
|
|
143
143
|
def exec_module(self, module: types.ModuleType) -> None: ...
|
|
@@ -142,6 +142,9 @@ class SupportsIter(Protocol[_T_co]):
|
|
|
142
142
|
class SupportsAiter(Protocol[_T_co]):
|
|
143
143
|
def __aiter__(self) -> _T_co: ...
|
|
144
144
|
|
|
145
|
+
class SupportsLen(Protocol):
|
|
146
|
+
def __len__(self) -> int: ...
|
|
147
|
+
|
|
145
148
|
class SupportsLenAndGetItem(Protocol[_T_co]):
|
|
146
149
|
def __len__(self) -> int: ...
|
|
147
150
|
def __getitem__(self, k: int, /) -> _T_co: ...
|
|
@@ -1912,10 +1912,20 @@ if sys.version_info < (3, 14):
|
|
|
1912
1912
|
_T = _TypeVar("_T", bound=AST)
|
|
1913
1913
|
|
|
1914
1914
|
if sys.version_info >= (3, 13):
|
|
1915
|
+
@overload
|
|
1916
|
+
def parse(
|
|
1917
|
+
source: _T,
|
|
1918
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
1919
|
+
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
|
|
1920
|
+
*,
|
|
1921
|
+
type_comments: bool = False,
|
|
1922
|
+
feature_version: None | int | tuple[int, int] = None,
|
|
1923
|
+
optimize: Literal[-1, 0, 1, 2] = -1,
|
|
1924
|
+
) -> _T: ...
|
|
1915
1925
|
@overload
|
|
1916
1926
|
def parse(
|
|
1917
1927
|
source: str | ReadableBuffer,
|
|
1918
|
-
filename: str |
|
|
1928
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
1919
1929
|
mode: Literal["exec"] = "exec",
|
|
1920
1930
|
*,
|
|
1921
1931
|
type_comments: bool = False,
|
|
@@ -1925,7 +1935,7 @@ if sys.version_info >= (3, 13):
|
|
|
1925
1935
|
@overload
|
|
1926
1936
|
def parse(
|
|
1927
1937
|
source: str | ReadableBuffer,
|
|
1928
|
-
filename: str |
|
|
1938
|
+
filename: str | bytes | os.PathLike[Any],
|
|
1929
1939
|
mode: Literal["eval"],
|
|
1930
1940
|
*,
|
|
1931
1941
|
type_comments: bool = False,
|
|
@@ -1935,7 +1945,7 @@ if sys.version_info >= (3, 13):
|
|
|
1935
1945
|
@overload
|
|
1936
1946
|
def parse(
|
|
1937
1947
|
source: str | ReadableBuffer,
|
|
1938
|
-
filename: str |
|
|
1948
|
+
filename: str | bytes | os.PathLike[Any],
|
|
1939
1949
|
mode: Literal["func_type"],
|
|
1940
1950
|
*,
|
|
1941
1951
|
type_comments: bool = False,
|
|
@@ -1945,7 +1955,7 @@ if sys.version_info >= (3, 13):
|
|
|
1945
1955
|
@overload
|
|
1946
1956
|
def parse(
|
|
1947
1957
|
source: str | ReadableBuffer,
|
|
1948
|
-
filename: str |
|
|
1958
|
+
filename: str | bytes | os.PathLike[Any],
|
|
1949
1959
|
mode: Literal["single"],
|
|
1950
1960
|
*,
|
|
1951
1961
|
type_comments: bool = False,
|
|
@@ -1982,7 +1992,7 @@ if sys.version_info >= (3, 13):
|
|
|
1982
1992
|
@overload
|
|
1983
1993
|
def parse(
|
|
1984
1994
|
source: str | ReadableBuffer,
|
|
1985
|
-
filename: str |
|
|
1995
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
1986
1996
|
mode: str = "exec",
|
|
1987
1997
|
*,
|
|
1988
1998
|
type_comments: bool = False,
|
|
@@ -1991,10 +2001,19 @@ if sys.version_info >= (3, 13):
|
|
|
1991
2001
|
) -> mod: ...
|
|
1992
2002
|
|
|
1993
2003
|
else:
|
|
2004
|
+
@overload
|
|
2005
|
+
def parse(
|
|
2006
|
+
source: _T,
|
|
2007
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
2008
|
+
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
|
|
2009
|
+
*,
|
|
2010
|
+
type_comments: bool = False,
|
|
2011
|
+
feature_version: None | int | tuple[int, int] = None,
|
|
2012
|
+
) -> _T: ...
|
|
1994
2013
|
@overload
|
|
1995
2014
|
def parse(
|
|
1996
2015
|
source: str | ReadableBuffer,
|
|
1997
|
-
filename: str |
|
|
2016
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
1998
2017
|
mode: Literal["exec"] = "exec",
|
|
1999
2018
|
*,
|
|
2000
2019
|
type_comments: bool = False,
|
|
@@ -2003,7 +2022,7 @@ else:
|
|
|
2003
2022
|
@overload
|
|
2004
2023
|
def parse(
|
|
2005
2024
|
source: str | ReadableBuffer,
|
|
2006
|
-
filename: str |
|
|
2025
|
+
filename: str | bytes | os.PathLike[Any],
|
|
2007
2026
|
mode: Literal["eval"],
|
|
2008
2027
|
*,
|
|
2009
2028
|
type_comments: bool = False,
|
|
@@ -2012,7 +2031,7 @@ else:
|
|
|
2012
2031
|
@overload
|
|
2013
2032
|
def parse(
|
|
2014
2033
|
source: str | ReadableBuffer,
|
|
2015
|
-
filename: str |
|
|
2034
|
+
filename: str | bytes | os.PathLike[Any],
|
|
2016
2035
|
mode: Literal["func_type"],
|
|
2017
2036
|
*,
|
|
2018
2037
|
type_comments: bool = False,
|
|
@@ -2021,7 +2040,7 @@ else:
|
|
|
2021
2040
|
@overload
|
|
2022
2041
|
def parse(
|
|
2023
2042
|
source: str | ReadableBuffer,
|
|
2024
|
-
filename: str |
|
|
2043
|
+
filename: str | bytes | os.PathLike[Any],
|
|
2025
2044
|
mode: Literal["single"],
|
|
2026
2045
|
*,
|
|
2027
2046
|
type_comments: bool = False,
|
|
@@ -2054,7 +2073,7 @@ else:
|
|
|
2054
2073
|
@overload
|
|
2055
2074
|
def parse(
|
|
2056
2075
|
source: str | ReadableBuffer,
|
|
2057
|
-
filename: str |
|
|
2076
|
+
filename: str | bytes | os.PathLike[Any] = "<unknown>",
|
|
2058
2077
|
mode: str = "exec",
|
|
2059
2078
|
*,
|
|
2060
2079
|
type_comments: bool = False,
|
|
@@ -365,10 +365,12 @@ class type:
|
|
|
365
365
|
"""Create the namespace for the class statement"""
|
|
366
366
|
...
|
|
367
367
|
if sys.version_info >= (3, 10):
|
|
368
|
-
|
|
368
|
+
# `int | str` produces an instance of `UnionType`, but `int | int` produces an instance of `type`,
|
|
369
|
+
# and `abc.ABC | abc.ABC` produces an instance of `abc.ABCMeta`.
|
|
370
|
+
def __or__(self: _typeshed.Self, value: Any, /) -> types.UnionType | _typeshed.Self:
|
|
369
371
|
"""Return self|value."""
|
|
370
372
|
...
|
|
371
|
-
def __ror__(self, value: Any, /) -> types.UnionType:
|
|
373
|
+
def __ror__(self: _typeshed.Self, value: Any, /) -> types.UnionType | _typeshed.Self:
|
|
372
374
|
"""Return value|self."""
|
|
373
375
|
...
|
|
374
376
|
if sys.version_info >= (3, 12):
|
|
@@ -424,7 +426,7 @@ class int:
|
|
|
424
426
|
4
|
|
425
427
|
"""
|
|
426
428
|
@overload
|
|
427
|
-
def __new__(cls, x: ConvertibleToInt =
|
|
429
|
+
def __new__(cls, x: ConvertibleToInt = 0, /) -> Self: ...
|
|
428
430
|
@overload
|
|
429
431
|
def __new__(cls, x: str | bytes | bytearray, /, base: SupportsIndex) -> Self: ...
|
|
430
432
|
def as_integer_ratio(self) -> tuple[int, Literal[1]]:
|
|
@@ -723,7 +725,7 @@ class int:
|
|
|
723
725
|
@disjoint_base
|
|
724
726
|
class float:
|
|
725
727
|
"""Convert a string or number to a floating-point number, if possible."""
|
|
726
|
-
def __new__(cls, x: ConvertibleToFloat =
|
|
728
|
+
def __new__(cls, x: ConvertibleToFloat = 0, /) -> Self: ...
|
|
727
729
|
def as_integer_ratio(self) -> tuple[int, int]:
|
|
728
730
|
"""
|
|
729
731
|
Return a pair of integers, whose ratio is exactly equal to the original float.
|
|
@@ -927,8 +929,8 @@ class complex:
|
|
|
927
929
|
@overload
|
|
928
930
|
def __new__(
|
|
929
931
|
cls,
|
|
930
|
-
real: complex | SupportsComplex | SupportsFloat | SupportsIndex =
|
|
931
|
-
imag: complex | SupportsFloat | SupportsIndex =
|
|
932
|
+
real: complex | SupportsComplex | SupportsFloat | SupportsIndex = 0,
|
|
933
|
+
imag: complex | SupportsFloat | SupportsIndex = 0,
|
|
932
934
|
) -> Self: ...
|
|
933
935
|
@overload
|
|
934
936
|
def __new__(cls, real: str | SupportsComplex | SupportsFloat | SupportsIndex | complex) -> Self: ...
|
|
@@ -1030,9 +1032,9 @@ class str(Sequence[str]):
|
|
|
1030
1032
|
errors defaults to 'strict'.
|
|
1031
1033
|
"""
|
|
1032
1034
|
@overload
|
|
1033
|
-
def __new__(cls, object: object =
|
|
1035
|
+
def __new__(cls, object: object = "") -> Self: ...
|
|
1034
1036
|
@overload
|
|
1035
|
-
def __new__(cls, object: ReadableBuffer, encoding: str =
|
|
1037
|
+
def __new__(cls, object: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> Self: ...
|
|
1036
1038
|
@overload
|
|
1037
1039
|
def capitalize(self: LiteralString) -> LiteralString:
|
|
1038
1040
|
"""
|
|
@@ -1075,7 +1077,7 @@ class str(Sequence[str]):
|
|
|
1075
1077
|
Padding is done using the specified fill character (default is a space).
|
|
1076
1078
|
"""
|
|
1077
1079
|
...
|
|
1078
|
-
def count(self, sub: str, start: SupportsIndex | None =
|
|
1080
|
+
def count(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int:
|
|
1079
1081
|
"""
|
|
1080
1082
|
Return the number of non-overlapping occurrences of substring sub in string S[start:end].
|
|
1081
1083
|
|
|
@@ -1097,7 +1099,7 @@ class str(Sequence[str]):
|
|
|
1097
1099
|
"""
|
|
1098
1100
|
...
|
|
1099
1101
|
def endswith(
|
|
1100
|
-
self, suffix: str | tuple[str, ...], start: SupportsIndex | None =
|
|
1102
|
+
self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
1101
1103
|
) -> bool:
|
|
1102
1104
|
"""
|
|
1103
1105
|
Return True if the string ends with the specified suffix, False otherwise.
|
|
@@ -1126,7 +1128,7 @@ class str(Sequence[str]):
|
|
|
1126
1128
|
If tabsize is not given, a tab size of 8 characters is assumed.
|
|
1127
1129
|
"""
|
|
1128
1130
|
...
|
|
1129
|
-
def find(self, sub: str, start: SupportsIndex | None =
|
|
1131
|
+
def find(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int:
|
|
1130
1132
|
"""
|
|
1131
1133
|
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
|
|
1132
1134
|
|
|
@@ -1154,7 +1156,7 @@ class str(Sequence[str]):
|
|
|
1154
1156
|
The substitutions are identified by braces ('{' and '}').
|
|
1155
1157
|
"""
|
|
1156
1158
|
...
|
|
1157
|
-
def index(self, sub: str, start: SupportsIndex | None =
|
|
1159
|
+
def index(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int:
|
|
1158
1160
|
"""
|
|
1159
1161
|
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
|
|
1160
1162
|
|
|
@@ -1420,7 +1422,7 @@ class str(Sequence[str]):
|
|
|
1420
1422
|
string.
|
|
1421
1423
|
"""
|
|
1422
1424
|
...
|
|
1423
|
-
def rfind(self, sub: str, start: SupportsIndex | None =
|
|
1425
|
+
def rfind(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int:
|
|
1424
1426
|
"""
|
|
1425
1427
|
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
|
|
1426
1428
|
|
|
@@ -1428,7 +1430,7 @@ class str(Sequence[str]):
|
|
|
1428
1430
|
Return -1 on failure.
|
|
1429
1431
|
"""
|
|
1430
1432
|
...
|
|
1431
|
-
def rindex(self, sub: str, start: SupportsIndex | None =
|
|
1433
|
+
def rindex(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int:
|
|
1432
1434
|
"""
|
|
1433
1435
|
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
|
|
1434
1436
|
|
|
@@ -1593,7 +1595,7 @@ class str(Sequence[str]):
|
|
|
1593
1595
|
"""
|
|
1594
1596
|
...
|
|
1595
1597
|
def startswith(
|
|
1596
|
-
self, prefix: str | tuple[str, ...], start: SupportsIndex | None =
|
|
1598
|
+
self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
1597
1599
|
) -> bool:
|
|
1598
1600
|
"""
|
|
1599
1601
|
Return True if the string starts with the specified prefix, False otherwise.
|
|
@@ -1829,7 +1831,7 @@ class bytes(Sequence[int]):
|
|
|
1829
1831
|
@overload
|
|
1830
1832
|
def __new__(cls, o: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, /) -> Self: ...
|
|
1831
1833
|
@overload
|
|
1832
|
-
def __new__(cls, string: str, /, encoding: str, errors: str =
|
|
1834
|
+
def __new__(cls, string: str, /, encoding: str, errors: str = "strict") -> Self: ...
|
|
1833
1835
|
@overload
|
|
1834
1836
|
def __new__(cls) -> Self: ...
|
|
1835
1837
|
def capitalize(self) -> bytes:
|
|
@@ -1848,7 +1850,7 @@ class bytes(Sequence[int]):
|
|
|
1848
1850
|
"""
|
|
1849
1851
|
...
|
|
1850
1852
|
def count(
|
|
1851
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
1853
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
1852
1854
|
) -> int:
|
|
1853
1855
|
"""
|
|
1854
1856
|
Return the number of non-overlapping occurrences of subsection 'sub' in bytes B[start:end].
|
|
@@ -1876,8 +1878,8 @@ class bytes(Sequence[int]):
|
|
|
1876
1878
|
def endswith(
|
|
1877
1879
|
self,
|
|
1878
1880
|
suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
|
|
1879
|
-
start: SupportsIndex | None =
|
|
1880
|
-
end: SupportsIndex | None =
|
|
1881
|
+
start: SupportsIndex | None = None,
|
|
1882
|
+
end: SupportsIndex | None = None,
|
|
1881
1883
|
/,
|
|
1882
1884
|
) -> bool:
|
|
1883
1885
|
"""
|
|
@@ -1899,7 +1901,7 @@ class bytes(Sequence[int]):
|
|
|
1899
1901
|
"""
|
|
1900
1902
|
...
|
|
1901
1903
|
def find(
|
|
1902
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
1904
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
1903
1905
|
) -> int:
|
|
1904
1906
|
"""
|
|
1905
1907
|
Return the lowest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
|
@@ -1912,7 +1914,7 @@ class bytes(Sequence[int]):
|
|
|
1912
1914
|
Return -1 on failure.
|
|
1913
1915
|
"""
|
|
1914
1916
|
...
|
|
1915
|
-
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex =
|
|
1917
|
+
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str:
|
|
1916
1918
|
r"""
|
|
1917
1919
|
Create a string of hexadecimal numbers from a bytes object.
|
|
1918
1920
|
|
|
@@ -1935,7 +1937,7 @@ class bytes(Sequence[int]):
|
|
|
1935
1937
|
"""
|
|
1936
1938
|
...
|
|
1937
1939
|
def index(
|
|
1938
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
1940
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
1939
1941
|
) -> int:
|
|
1940
1942
|
"""
|
|
1941
1943
|
Return the lowest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
|
@@ -2088,7 +2090,7 @@ class bytes(Sequence[int]):
|
|
|
2088
2090
|
"""
|
|
2089
2091
|
...
|
|
2090
2092
|
def rfind(
|
|
2091
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2093
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2092
2094
|
) -> int:
|
|
2093
2095
|
"""
|
|
2094
2096
|
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
|
@@ -2102,7 +2104,7 @@ class bytes(Sequence[int]):
|
|
|
2102
2104
|
"""
|
|
2103
2105
|
...
|
|
2104
2106
|
def rindex(
|
|
2105
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2107
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2106
2108
|
) -> int:
|
|
2107
2109
|
"""
|
|
2108
2110
|
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
|
@@ -2180,8 +2182,8 @@ class bytes(Sequence[int]):
|
|
|
2180
2182
|
def startswith(
|
|
2181
2183
|
self,
|
|
2182
2184
|
prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
|
|
2183
|
-
start: SupportsIndex | None =
|
|
2184
|
-
end: SupportsIndex | None =
|
|
2185
|
+
start: SupportsIndex | None = None,
|
|
2186
|
+
end: SupportsIndex | None = None,
|
|
2185
2187
|
/,
|
|
2186
2188
|
) -> bool:
|
|
2187
2189
|
"""
|
|
@@ -2345,7 +2347,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2345
2347
|
@overload
|
|
2346
2348
|
def __init__(self, ints: Iterable[SupportsIndex] | SupportsIndex | ReadableBuffer, /) -> None: ...
|
|
2347
2349
|
@overload
|
|
2348
|
-
def __init__(self, string: str, /, encoding: str, errors: str =
|
|
2350
|
+
def __init__(self, string: str, /, encoding: str, errors: str = "strict") -> None: ...
|
|
2349
2351
|
def append(self, item: SupportsIndex, /) -> None:
|
|
2350
2352
|
"""
|
|
2351
2353
|
Append a single item to the end of the bytearray.
|
|
@@ -2370,7 +2372,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2370
2372
|
"""
|
|
2371
2373
|
...
|
|
2372
2374
|
def count(
|
|
2373
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2375
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2374
2376
|
) -> int:
|
|
2375
2377
|
"""
|
|
2376
2378
|
Return the number of non-overlapping occurrences of subsection 'sub' in bytes B[start:end].
|
|
@@ -2401,8 +2403,8 @@ class bytearray(MutableSequence[int]):
|
|
|
2401
2403
|
def endswith(
|
|
2402
2404
|
self,
|
|
2403
2405
|
suffix: ReadableBuffer | tuple[ReadableBuffer, ...],
|
|
2404
|
-
start: SupportsIndex | None =
|
|
2405
|
-
end: SupportsIndex | None =
|
|
2406
|
+
start: SupportsIndex | None = None,
|
|
2407
|
+
end: SupportsIndex | None = None,
|
|
2406
2408
|
/,
|
|
2407
2409
|
) -> bool:
|
|
2408
2410
|
"""
|
|
@@ -2432,7 +2434,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2432
2434
|
"""
|
|
2433
2435
|
...
|
|
2434
2436
|
def find(
|
|
2435
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2437
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2436
2438
|
) -> int:
|
|
2437
2439
|
"""
|
|
2438
2440
|
Return the lowest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start:end].
|
|
@@ -2445,7 +2447,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2445
2447
|
Return -1 on failure.
|
|
2446
2448
|
"""
|
|
2447
2449
|
...
|
|
2448
|
-
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex =
|
|
2450
|
+
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str:
|
|
2449
2451
|
"""
|
|
2450
2452
|
Create a string of hexadecimal numbers from a bytearray object.
|
|
2451
2453
|
|
|
@@ -2468,7 +2470,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2468
2470
|
"""
|
|
2469
2471
|
...
|
|
2470
2472
|
def index(
|
|
2471
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2473
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2472
2474
|
) -> int:
|
|
2473
2475
|
"""
|
|
2474
2476
|
Return the lowest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start:end].
|
|
@@ -2649,7 +2651,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2649
2651
|
"""
|
|
2650
2652
|
...
|
|
2651
2653
|
def rfind(
|
|
2652
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2654
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2653
2655
|
) -> int:
|
|
2654
2656
|
"""
|
|
2655
2657
|
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start:end].
|
|
@@ -2663,7 +2665,7 @@ class bytearray(MutableSequence[int]):
|
|
|
2663
2665
|
"""
|
|
2664
2666
|
...
|
|
2665
2667
|
def rindex(
|
|
2666
|
-
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None =
|
|
2668
|
+
self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /
|
|
2667
2669
|
) -> int:
|
|
2668
2670
|
"""
|
|
2669
2671
|
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start:end].
|
|
@@ -2742,8 +2744,8 @@ class bytearray(MutableSequence[int]):
|
|
|
2742
2744
|
def startswith(
|
|
2743
2745
|
self,
|
|
2744
2746
|
prefix: ReadableBuffer | tuple[ReadableBuffer, ...],
|
|
2745
|
-
start: SupportsIndex | None =
|
|
2746
|
-
end: SupportsIndex | None =
|
|
2747
|
+
start: SupportsIndex | None = None,
|
|
2748
|
+
end: SupportsIndex | None = None,
|
|
2747
2749
|
/,
|
|
2748
2750
|
) -> bool:
|
|
2749
2751
|
"""
|
|
@@ -3065,7 +3067,7 @@ class memoryview(Sequence[_I]):
|
|
|
3065
3067
|
def release(self) -> None:
|
|
3066
3068
|
"""Release the underlying buffer exposed by the memoryview object."""
|
|
3067
3069
|
...
|
|
3068
|
-
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex =
|
|
3070
|
+
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str:
|
|
3069
3071
|
r"""
|
|
3070
3072
|
Return the data in the buffer as a str of hexadecimal numbers.
|
|
3071
3073
|
|
|
@@ -3110,7 +3112,7 @@ class bool(int):
|
|
|
3110
3112
|
The builtins True and False are the only two instances of the class bool.
|
|
3111
3113
|
The class bool is a subclass of the class int, and cannot be subclassed.
|
|
3112
3114
|
"""
|
|
3113
|
-
def __new__(cls, o: object =
|
|
3115
|
+
def __new__(cls, o: object = False, /) -> Self: ...
|
|
3114
3116
|
# The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
|
|
3115
3117
|
# however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880).
|
|
3116
3118
|
@overload
|
|
@@ -3236,7 +3238,7 @@ class tuple(Sequence[_T_co]):
|
|
|
3236
3238
|
|
|
3237
3239
|
If the argument is a tuple, the return value is the same object.
|
|
3238
3240
|
"""
|
|
3239
|
-
def __new__(cls, iterable: Iterable[_T_co] =
|
|
3241
|
+
def __new__(cls, iterable: Iterable[_T_co] = (), /) -> Self: ...
|
|
3240
3242
|
def __len__(self) -> int:
|
|
3241
3243
|
"""Return len(self)."""
|
|
3242
3244
|
...
|
|
@@ -3905,7 +3907,7 @@ class range(Sequence[int]):
|
|
|
3905
3907
|
@overload
|
|
3906
3908
|
def __new__(cls, stop: SupportsIndex, /) -> Self: ...
|
|
3907
3909
|
@overload
|
|
3908
|
-
def __new__(cls, start: SupportsIndex, stop: SupportsIndex, step: SupportsIndex =
|
|
3910
|
+
def __new__(cls, start: SupportsIndex, stop: SupportsIndex, step: SupportsIndex = 1, /) -> Self: ...
|
|
3909
3911
|
def count(self, value: int, /) -> int:
|
|
3910
3912
|
"""rangeobject.count(value) -> integer -- return number of occurrences of value"""
|
|
3911
3913
|
...
|
|
@@ -3987,10 +3989,10 @@ class property:
|
|
|
3987
3989
|
|
|
3988
3990
|
def __init__(
|
|
3989
3991
|
self,
|
|
3990
|
-
fget: Callable[[Any], Any] | None =
|
|
3991
|
-
fset: Callable[[Any, Any], None] | None =
|
|
3992
|
-
fdel: Callable[[Any], None] | None =
|
|
3993
|
-
doc: str | None =
|
|
3992
|
+
fget: Callable[[Any], Any] | None = None,
|
|
3993
|
+
fset: Callable[[Any, Any], None] | None = None,
|
|
3994
|
+
fdel: Callable[[Any], None] | None = None,
|
|
3995
|
+
doc: str | None = None,
|
|
3994
3996
|
) -> None: ...
|
|
3995
3997
|
def getter(self, fget: Callable[[Any], Any], /) -> property:
|
|
3996
3998
|
"""Descriptor to obtain a copy of the property with a different getter."""
|
|
@@ -4114,7 +4116,7 @@ if sys.version_info >= (3, 10):
|
|
|
4114
4116
|
@overload
|
|
4115
4117
|
def compile(
|
|
4116
4118
|
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
|
|
4117
|
-
filename: str |
|
|
4119
|
+
filename: str | bytes | PathLike[Any],
|
|
4118
4120
|
mode: str,
|
|
4119
4121
|
flags: Literal[0],
|
|
4120
4122
|
dont_inherit: bool = False,
|
|
@@ -4140,7 +4142,7 @@ def compile(
|
|
|
4140
4142
|
@overload
|
|
4141
4143
|
def compile(
|
|
4142
4144
|
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
|
|
4143
|
-
filename: str |
|
|
4145
|
+
filename: str | bytes | PathLike[Any],
|
|
4144
4146
|
mode: str,
|
|
4145
4147
|
*,
|
|
4146
4148
|
dont_inherit: bool = False,
|
|
@@ -4165,7 +4167,7 @@ def compile(
|
|
|
4165
4167
|
@overload
|
|
4166
4168
|
def compile(
|
|
4167
4169
|
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
|
|
4168
|
-
filename: str |
|
|
4170
|
+
filename: str | bytes | PathLike[Any],
|
|
4169
4171
|
mode: str,
|
|
4170
4172
|
flags: Literal[1024],
|
|
4171
4173
|
dont_inherit: bool = False,
|
|
@@ -4191,7 +4193,7 @@ def compile(
|
|
|
4191
4193
|
@overload
|
|
4192
4194
|
def compile(
|
|
4193
4195
|
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
|
|
4194
|
-
filename: str |
|
|
4196
|
+
filename: str | bytes | PathLike[Any],
|
|
4195
4197
|
mode: str,
|
|
4196
4198
|
flags: int,
|
|
4197
4199
|
dont_inherit: bool = False,
|
|
@@ -6135,18 +6137,25 @@ class zip(Generic[_T_co]):
|
|
|
6135
6137
|
"""
|
|
6136
6138
|
if sys.version_info >= (3, 10):
|
|
6137
6139
|
@overload
|
|
6138
|
-
def __new__(cls, *, strict: bool =
|
|
6140
|
+
def __new__(cls, *, strict: bool = False) -> zip[Any]: ...
|
|
6139
6141
|
@overload
|
|
6140
|
-
def __new__(cls, iter1: Iterable[_T1], /, *, strict: bool =
|
|
6142
|
+
def __new__(cls, iter1: Iterable[_T1], /, *, strict: bool = False) -> zip[tuple[_T1]]: ...
|
|
6141
6143
|
@overload
|
|
6142
|
-
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /, *, strict: bool =
|
|
6144
|
+
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /, *, strict: bool = False) -> zip[tuple[_T1, _T2]]: ...
|
|
6143
6145
|
@overload
|
|
6144
6146
|
def __new__(
|
|
6145
|
-
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, strict: bool =
|
|
6147
|
+
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, strict: bool = False
|
|
6146
6148
|
) -> zip[tuple[_T1, _T2, _T3]]: ...
|
|
6147
6149
|
@overload
|
|
6148
6150
|
def __new__(
|
|
6149
|
-
cls,
|
|
6151
|
+
cls,
|
|
6152
|
+
iter1: Iterable[_T1],
|
|
6153
|
+
iter2: Iterable[_T2],
|
|
6154
|
+
iter3: Iterable[_T3],
|
|
6155
|
+
iter4: Iterable[_T4],
|
|
6156
|
+
/,
|
|
6157
|
+
*,
|
|
6158
|
+
strict: bool = False,
|
|
6150
6159
|
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
|
|
6151
6160
|
@overload
|
|
6152
6161
|
def __new__(
|
|
@@ -6158,7 +6167,7 @@ class zip(Generic[_T_co]):
|
|
|
6158
6167
|
iter5: Iterable[_T5],
|
|
6159
6168
|
/,
|
|
6160
6169
|
*,
|
|
6161
|
-
strict: bool =
|
|
6170
|
+
strict: bool = False,
|
|
6162
6171
|
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
|
6163
6172
|
@overload
|
|
6164
6173
|
def __new__(
|
|
@@ -6171,7 +6180,7 @@ class zip(Generic[_T_co]):
|
|
|
6171
6180
|
iter6: Iterable[Any],
|
|
6172
6181
|
/,
|
|
6173
6182
|
*iterables: Iterable[Any],
|
|
6174
|
-
strict: bool =
|
|
6183
|
+
strict: bool = False,
|
|
6175
6184
|
) -> zip[tuple[Any, ...]]: ...
|
|
6176
6185
|
else:
|
|
6177
6186
|
@overload
|
|
@@ -6216,7 +6225,7 @@ def __import__(
|
|
|
6216
6225
|
name: str,
|
|
6217
6226
|
globals: Mapping[str, object] | None = None,
|
|
6218
6227
|
locals: Mapping[str, object] | None = None,
|
|
6219
|
-
fromlist: Sequence[str] = (),
|
|
6228
|
+
fromlist: Sequence[str] | None = (),
|
|
6220
6229
|
level: int = 0,
|
|
6221
6230
|
) -> types.ModuleType:
|
|
6222
6231
|
"""
|
|
@@ -6277,6 +6286,14 @@ class BaseException:
|
|
|
6277
6286
|
def with_traceback(self, tb: TracebackType | None, /) -> Self:
|
|
6278
6287
|
"""Set self.__traceback__ to tb and return self."""
|
|
6279
6288
|
...
|
|
6289
|
+
# Necessary for security-focused static analyzers (e.g, pysa)
|
|
6290
|
+
# See https://github.com/python/typeshed/pull/14900
|
|
6291
|
+
def __str__(self) -> str:
|
|
6292
|
+
"""Return str(self)."""
|
|
6293
|
+
...
|
|
6294
|
+
def __repr__(self) -> str:
|
|
6295
|
+
"""Return repr(self)."""
|
|
6296
|
+
...
|
|
6280
6297
|
if sys.version_info >= (3, 11):
|
|
6281
6298
|
# only present after add_note() is called
|
|
6282
6299
|
__notes__: list[str]
|
|
@@ -6332,8 +6349,8 @@ if sys.version_info >= (3, 10):
|
|
|
6332
6349
|
@disjoint_base
|
|
6333
6350
|
class AttributeError(Exception):
|
|
6334
6351
|
"""Attribute not found."""
|
|
6335
|
-
def __init__(self, *args: object, name: str | None =
|
|
6336
|
-
name: str
|
|
6352
|
+
def __init__(self, *args: object, name: str | None = None, obj: object = None) -> None: ...
|
|
6353
|
+
name: str | None
|
|
6337
6354
|
obj: object
|
|
6338
6355
|
|
|
6339
6356
|
else:
|
|
@@ -6349,7 +6366,7 @@ class EOFError(Exception):
|
|
|
6349
6366
|
@disjoint_base
|
|
6350
6367
|
class ImportError(Exception):
|
|
6351
6368
|
"""Import can't find module, or can't find name in module."""
|
|
6352
|
-
def __init__(self, *args: object, name: str | None =
|
|
6369
|
+
def __init__(self, *args: object, name: str | None = None, path: str | None = None) -> None: ...
|
|
6353
6370
|
name: str | None
|
|
6354
6371
|
path: str | None
|
|
6355
6372
|
msg: str # undocumented
|
|
@@ -6367,8 +6384,8 @@ if sys.version_info >= (3, 10):
|
|
|
6367
6384
|
@disjoint_base
|
|
6368
6385
|
class NameError(Exception):
|
|
6369
6386
|
"""Name not found globally."""
|
|
6370
|
-
def __init__(self, *args: object, name: str | None =
|
|
6371
|
-
name: str
|
|
6387
|
+
def __init__(self, *args: object, name: str | None = None) -> None: ...
|
|
6388
|
+
name: str | None
|
|
6372
6389
|
|
|
6373
6390
|
else:
|
|
6374
6391
|
class NameError(Exception): ...
|