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,92 +1,92 @@
|
|
|
1
|
-
"""json speedups"""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from typing import Any, final
|
|
5
|
-
|
|
6
|
-
@final
|
|
7
|
-
class make_encoder:
|
|
8
|
-
"""_iterencode(obj, _current_indent_level) -> iterable"""
|
|
9
|
-
@property
|
|
10
|
-
def sort_keys(self) -> bool:
|
|
11
|
-
"""sort_keys"""
|
|
12
|
-
...
|
|
13
|
-
@property
|
|
14
|
-
def skipkeys(self) -> bool:
|
|
15
|
-
"""skipkeys"""
|
|
16
|
-
...
|
|
17
|
-
@property
|
|
18
|
-
def key_separator(self) -> str:
|
|
19
|
-
"""key_separator"""
|
|
20
|
-
...
|
|
21
|
-
@property
|
|
22
|
-
def indent(self) -> int | None:
|
|
23
|
-
"""indent"""
|
|
24
|
-
...
|
|
25
|
-
@property
|
|
26
|
-
def markers(self) -> dict[int, Any] | None:
|
|
27
|
-
"""markers"""
|
|
28
|
-
...
|
|
29
|
-
@property
|
|
30
|
-
def default(self) -> Callable[[Any], Any]:
|
|
31
|
-
"""default"""
|
|
32
|
-
...
|
|
33
|
-
@property
|
|
34
|
-
def encoder(self) -> Callable[[str], str]:
|
|
35
|
-
"""encoder"""
|
|
36
|
-
...
|
|
37
|
-
@property
|
|
38
|
-
def item_separator(self) -> str:
|
|
39
|
-
"""item_separator"""
|
|
40
|
-
...
|
|
41
|
-
def __init__(
|
|
42
|
-
self,
|
|
43
|
-
markers: dict[int, Any] | None,
|
|
44
|
-
default: Callable[[Any], Any],
|
|
45
|
-
encoder: Callable[[str], str],
|
|
46
|
-
indent: int | None,
|
|
47
|
-
key_separator: str,
|
|
48
|
-
item_separator: str,
|
|
49
|
-
sort_keys: bool,
|
|
50
|
-
skipkeys: bool,
|
|
51
|
-
allow_nan: bool,
|
|
52
|
-
) -> None: ...
|
|
53
|
-
def __call__(self, obj: object, _current_indent_level: int) -> Any:
|
|
54
|
-
"""Call self as a function."""
|
|
55
|
-
...
|
|
56
|
-
|
|
57
|
-
@final
|
|
58
|
-
class make_scanner:
|
|
59
|
-
"""JSON scanner object"""
|
|
60
|
-
object_hook: Any
|
|
61
|
-
object_pairs_hook: Any
|
|
62
|
-
parse_int: Any
|
|
63
|
-
parse_constant: Any
|
|
64
|
-
parse_float: Any
|
|
65
|
-
strict: bool
|
|
66
|
-
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
|
|
67
|
-
def __init__(self, context: make_scanner) -> None: ...
|
|
68
|
-
def __call__(self, string: str, index: int) -> tuple[Any, int]:
|
|
69
|
-
"""Call self as a function."""
|
|
70
|
-
...
|
|
71
|
-
|
|
72
|
-
def encode_basestring_ascii(s: str, /) -> str:
|
|
73
|
-
"""
|
|
74
|
-
encode_basestring_ascii(string) -> string
|
|
75
|
-
|
|
76
|
-
Return an ASCII-only JSON representation of a Python string
|
|
77
|
-
"""
|
|
78
|
-
...
|
|
79
|
-
def scanstring(string: str, end: int, strict: bool = ...) -> tuple[str, int]:
|
|
80
|
-
"""
|
|
81
|
-
scanstring(string, end, strict=True) -> (string, end)
|
|
82
|
-
|
|
83
|
-
Scan the string s for a JSON string. End is the index of the
|
|
84
|
-
character in s after the quote that started the JSON string.
|
|
85
|
-
Unescapes all valid JSON string escape sequences and raises ValueError
|
|
86
|
-
on attempt to decode an invalid string. If strict is False then literal
|
|
87
|
-
control characters are allowed in the string.
|
|
88
|
-
|
|
89
|
-
Returns a tuple of the decoded string and the index of the character in s
|
|
90
|
-
after the end quote.
|
|
91
|
-
"""
|
|
92
|
-
...
|
|
1
|
+
"""json speedups"""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any, final
|
|
5
|
+
|
|
6
|
+
@final
|
|
7
|
+
class make_encoder:
|
|
8
|
+
"""_iterencode(obj, _current_indent_level) -> iterable"""
|
|
9
|
+
@property
|
|
10
|
+
def sort_keys(self) -> bool:
|
|
11
|
+
"""sort_keys"""
|
|
12
|
+
...
|
|
13
|
+
@property
|
|
14
|
+
def skipkeys(self) -> bool:
|
|
15
|
+
"""skipkeys"""
|
|
16
|
+
...
|
|
17
|
+
@property
|
|
18
|
+
def key_separator(self) -> str:
|
|
19
|
+
"""key_separator"""
|
|
20
|
+
...
|
|
21
|
+
@property
|
|
22
|
+
def indent(self) -> int | None:
|
|
23
|
+
"""indent"""
|
|
24
|
+
...
|
|
25
|
+
@property
|
|
26
|
+
def markers(self) -> dict[int, Any] | None:
|
|
27
|
+
"""markers"""
|
|
28
|
+
...
|
|
29
|
+
@property
|
|
30
|
+
def default(self) -> Callable[[Any], Any]:
|
|
31
|
+
"""default"""
|
|
32
|
+
...
|
|
33
|
+
@property
|
|
34
|
+
def encoder(self) -> Callable[[str], str]:
|
|
35
|
+
"""encoder"""
|
|
36
|
+
...
|
|
37
|
+
@property
|
|
38
|
+
def item_separator(self) -> str:
|
|
39
|
+
"""item_separator"""
|
|
40
|
+
...
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
markers: dict[int, Any] | None,
|
|
44
|
+
default: Callable[[Any], Any],
|
|
45
|
+
encoder: Callable[[str], str],
|
|
46
|
+
indent: int | None,
|
|
47
|
+
key_separator: str,
|
|
48
|
+
item_separator: str,
|
|
49
|
+
sort_keys: bool,
|
|
50
|
+
skipkeys: bool,
|
|
51
|
+
allow_nan: bool,
|
|
52
|
+
) -> None: ...
|
|
53
|
+
def __call__(self, obj: object, _current_indent_level: int) -> Any:
|
|
54
|
+
"""Call self as a function."""
|
|
55
|
+
...
|
|
56
|
+
|
|
57
|
+
@final
|
|
58
|
+
class make_scanner:
|
|
59
|
+
"""JSON scanner object"""
|
|
60
|
+
object_hook: Any
|
|
61
|
+
object_pairs_hook: Any
|
|
62
|
+
parse_int: Any
|
|
63
|
+
parse_constant: Any
|
|
64
|
+
parse_float: Any
|
|
65
|
+
strict: bool
|
|
66
|
+
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
|
|
67
|
+
def __init__(self, context: make_scanner) -> None: ...
|
|
68
|
+
def __call__(self, string: str, index: int) -> tuple[Any, int]:
|
|
69
|
+
"""Call self as a function."""
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
def encode_basestring_ascii(s: str, /) -> str:
|
|
73
|
+
"""
|
|
74
|
+
encode_basestring_ascii(string) -> string
|
|
75
|
+
|
|
76
|
+
Return an ASCII-only JSON representation of a Python string
|
|
77
|
+
"""
|
|
78
|
+
...
|
|
79
|
+
def scanstring(string: str, end: int, strict: bool = ...) -> tuple[str, int]:
|
|
80
|
+
"""
|
|
81
|
+
scanstring(string, end, strict=True) -> (string, end)
|
|
82
|
+
|
|
83
|
+
Scan the string s for a JSON string. End is the index of the
|
|
84
|
+
character in s after the quote that started the JSON string.
|
|
85
|
+
Unescapes all valid JSON string escape sequences and raises ValueError
|
|
86
|
+
on attempt to decode an invalid string. If strict is False then literal
|
|
87
|
+
control characters are allowed in the string.
|
|
88
|
+
|
|
89
|
+
Returns a tuple of the decoded string and the index of the character in s
|
|
90
|
+
after the end quote.
|
|
91
|
+
"""
|
|
92
|
+
...
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
"""Fast profiler"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from _typeshed import structseq
|
|
5
|
-
from collections.abc import Callable
|
|
6
|
-
from types import CodeType
|
|
7
|
-
from typing import Any, Final, final
|
|
8
|
-
|
|
9
|
-
class Profiler:
|
|
10
|
-
"""
|
|
11
|
-
Profiler(timer=None, timeunit=None, subcalls=True, builtins=True)
|
|
12
|
-
|
|
13
|
-
Builds a profiler object using the specified timer function.
|
|
14
|
-
The default timer is a fast built-in one based on real time.
|
|
15
|
-
For custom timer functions returning integers, timeunit can
|
|
16
|
-
be a float specifying a scale (i.e. how long each integer unit
|
|
17
|
-
is, in seconds).
|
|
18
|
-
"""
|
|
19
|
-
def __init__(
|
|
20
|
-
self, timer: Callable[[], float] | None = None, timeunit: float = 0.0, subcalls: bool = True, builtins: bool = True
|
|
21
|
-
) -> None: ...
|
|
22
|
-
def getstats(self) -> list[profiler_entry]:
|
|
23
|
-
"""
|
|
24
|
-
getstats() -> list of profiler_entry objects
|
|
25
|
-
|
|
26
|
-
Return all information collected by the profiler.
|
|
27
|
-
Each profiler_entry is a tuple-like object with the
|
|
28
|
-
following attributes:
|
|
29
|
-
|
|
30
|
-
code code object
|
|
31
|
-
callcount how many times this was called
|
|
32
|
-
reccallcount how many times called recursively
|
|
33
|
-
totaltime total time in this entry
|
|
34
|
-
inlinetime inline time in this entry (not in subcalls)
|
|
35
|
-
calls details of the calls
|
|
36
|
-
|
|
37
|
-
The calls attribute is either None or a list of
|
|
38
|
-
profiler_subentry objects:
|
|
39
|
-
|
|
40
|
-
code called code object
|
|
41
|
-
callcount how many times this is called
|
|
42
|
-
reccallcount how many times this is called recursively
|
|
43
|
-
totaltime total time spent in this call
|
|
44
|
-
inlinetime inline time (not in further subcalls)
|
|
45
|
-
"""
|
|
46
|
-
...
|
|
47
|
-
def enable(self, subcalls: bool = True, builtins: bool = True) -> None:
|
|
48
|
-
"""
|
|
49
|
-
enable(subcalls=True, builtins=True)
|
|
50
|
-
|
|
51
|
-
Start collecting profiling information.
|
|
52
|
-
If 'subcalls' is True, also records for each function
|
|
53
|
-
statistics separated according to its current caller.
|
|
54
|
-
If 'builtins' is True, records the time spent in
|
|
55
|
-
built-in functions separately from their caller.
|
|
56
|
-
"""
|
|
57
|
-
...
|
|
58
|
-
def disable(self) -> None:
|
|
59
|
-
"""
|
|
60
|
-
disable()
|
|
61
|
-
|
|
62
|
-
Stop collecting profiling information.
|
|
63
|
-
"""
|
|
64
|
-
...
|
|
65
|
-
def clear(self) -> None:
|
|
66
|
-
"""
|
|
67
|
-
clear()
|
|
68
|
-
|
|
69
|
-
Clear all profiling information collected so far.
|
|
70
|
-
"""
|
|
71
|
-
...
|
|
72
|
-
|
|
73
|
-
@final
|
|
74
|
-
class profiler_entry(structseq[Any], tuple[CodeType | str, int, int, float, float, list[profiler_subentry]]):
|
|
75
|
-
if sys.version_info >= (3, 10):
|
|
76
|
-
__match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime", "calls")
|
|
77
|
-
code: CodeType | str
|
|
78
|
-
callcount: int
|
|
79
|
-
reccallcount: int
|
|
80
|
-
totaltime: float
|
|
81
|
-
inlinetime: float
|
|
82
|
-
calls: list[profiler_subentry]
|
|
83
|
-
|
|
84
|
-
@final
|
|
85
|
-
class profiler_subentry(structseq[Any], tuple[CodeType | str, int, int, float, float]):
|
|
86
|
-
if sys.version_info >= (3, 10):
|
|
87
|
-
__match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime")
|
|
88
|
-
code: CodeType | str
|
|
89
|
-
callcount: int
|
|
90
|
-
reccallcount: int
|
|
91
|
-
totaltime: float
|
|
92
|
-
inlinetime: float
|
|
1
|
+
"""Fast profiler"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from _typeshed import structseq
|
|
5
|
+
from collections.abc import Callable
|
|
6
|
+
from types import CodeType
|
|
7
|
+
from typing import Any, Final, final
|
|
8
|
+
|
|
9
|
+
class Profiler:
|
|
10
|
+
"""
|
|
11
|
+
Profiler(timer=None, timeunit=None, subcalls=True, builtins=True)
|
|
12
|
+
|
|
13
|
+
Builds a profiler object using the specified timer function.
|
|
14
|
+
The default timer is a fast built-in one based on real time.
|
|
15
|
+
For custom timer functions returning integers, timeunit can
|
|
16
|
+
be a float specifying a scale (i.e. how long each integer unit
|
|
17
|
+
is, in seconds).
|
|
18
|
+
"""
|
|
19
|
+
def __init__(
|
|
20
|
+
self, timer: Callable[[], float] | None = None, timeunit: float = 0.0, subcalls: bool = True, builtins: bool = True
|
|
21
|
+
) -> None: ...
|
|
22
|
+
def getstats(self) -> list[profiler_entry]:
|
|
23
|
+
"""
|
|
24
|
+
getstats() -> list of profiler_entry objects
|
|
25
|
+
|
|
26
|
+
Return all information collected by the profiler.
|
|
27
|
+
Each profiler_entry is a tuple-like object with the
|
|
28
|
+
following attributes:
|
|
29
|
+
|
|
30
|
+
code code object
|
|
31
|
+
callcount how many times this was called
|
|
32
|
+
reccallcount how many times called recursively
|
|
33
|
+
totaltime total time in this entry
|
|
34
|
+
inlinetime inline time in this entry (not in subcalls)
|
|
35
|
+
calls details of the calls
|
|
36
|
+
|
|
37
|
+
The calls attribute is either None or a list of
|
|
38
|
+
profiler_subentry objects:
|
|
39
|
+
|
|
40
|
+
code called code object
|
|
41
|
+
callcount how many times this is called
|
|
42
|
+
reccallcount how many times this is called recursively
|
|
43
|
+
totaltime total time spent in this call
|
|
44
|
+
inlinetime inline time (not in further subcalls)
|
|
45
|
+
"""
|
|
46
|
+
...
|
|
47
|
+
def enable(self, subcalls: bool = True, builtins: bool = True) -> None:
|
|
48
|
+
"""
|
|
49
|
+
enable(subcalls=True, builtins=True)
|
|
50
|
+
|
|
51
|
+
Start collecting profiling information.
|
|
52
|
+
If 'subcalls' is True, also records for each function
|
|
53
|
+
statistics separated according to its current caller.
|
|
54
|
+
If 'builtins' is True, records the time spent in
|
|
55
|
+
built-in functions separately from their caller.
|
|
56
|
+
"""
|
|
57
|
+
...
|
|
58
|
+
def disable(self) -> None:
|
|
59
|
+
"""
|
|
60
|
+
disable()
|
|
61
|
+
|
|
62
|
+
Stop collecting profiling information.
|
|
63
|
+
"""
|
|
64
|
+
...
|
|
65
|
+
def clear(self) -> None:
|
|
66
|
+
"""
|
|
67
|
+
clear()
|
|
68
|
+
|
|
69
|
+
Clear all profiling information collected so far.
|
|
70
|
+
"""
|
|
71
|
+
...
|
|
72
|
+
|
|
73
|
+
@final
|
|
74
|
+
class profiler_entry(structseq[Any], tuple[CodeType | str, int, int, float, float, list[profiler_subentry]]):
|
|
75
|
+
if sys.version_info >= (3, 10):
|
|
76
|
+
__match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime", "calls")
|
|
77
|
+
code: CodeType | str
|
|
78
|
+
callcount: int
|
|
79
|
+
reccallcount: int
|
|
80
|
+
totaltime: float
|
|
81
|
+
inlinetime: float
|
|
82
|
+
calls: list[profiler_subentry]
|
|
83
|
+
|
|
84
|
+
@final
|
|
85
|
+
class profiler_subentry(structseq[Any], tuple[CodeType | str, int, int, float, float]):
|
|
86
|
+
if sys.version_info >= (3, 10):
|
|
87
|
+
__match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime")
|
|
88
|
+
code: CodeType | str
|
|
89
|
+
callcount: int
|
|
90
|
+
reccallcount: int
|
|
91
|
+
totaltime: float
|
|
92
|
+
inlinetime: float
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"""Module implements the Mersenne Twister random number generator."""
|
|
2
|
-
|
|
3
|
-
from typing_extensions import TypeAlias
|
|
4
|
-
|
|
5
|
-
# Actually Tuple[(int,) * 625]
|
|
6
|
-
_State: TypeAlias = tuple[int, ...]
|
|
7
|
-
|
|
8
|
-
class Random:
|
|
9
|
-
"""Random() -> create a random number generator with its own internal state."""
|
|
10
|
-
def __init__(self, seed: object = ...) -> None: ...
|
|
11
|
-
def seed(self, n: object = None, /) -> None:
|
|
12
|
-
"""
|
|
13
|
-
seed([n]) -> None.
|
|
14
|
-
|
|
15
|
-
Defaults to use urandom and falls back to a combination
|
|
16
|
-
of the current time and the process identifier.
|
|
17
|
-
"""
|
|
18
|
-
...
|
|
19
|
-
def getstate(self) -> _State:
|
|
20
|
-
"""getstate() -> tuple containing the current state."""
|
|
21
|
-
...
|
|
22
|
-
def setstate(self, state: _State, /) -> None:
|
|
23
|
-
"""setstate(state) -> None. Restores generator state."""
|
|
24
|
-
...
|
|
25
|
-
def random(self) -> float:
|
|
26
|
-
"""random() -> x in the interval [0, 1)."""
|
|
27
|
-
...
|
|
28
|
-
def getrandbits(self, k: int, /) -> int:
|
|
29
|
-
"""getrandbits(k) -> x. Generates an int with k random bits."""
|
|
30
|
-
...
|
|
1
|
+
"""Module implements the Mersenne Twister random number generator."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypeAlias
|
|
4
|
+
|
|
5
|
+
# Actually Tuple[(int,) * 625]
|
|
6
|
+
_State: TypeAlias = tuple[int, ...]
|
|
7
|
+
|
|
8
|
+
class Random:
|
|
9
|
+
"""Random() -> create a random number generator with its own internal state."""
|
|
10
|
+
def __init__(self, seed: object = ...) -> None: ...
|
|
11
|
+
def seed(self, n: object = None, /) -> None:
|
|
12
|
+
"""
|
|
13
|
+
seed([n]) -> None.
|
|
14
|
+
|
|
15
|
+
Defaults to use urandom and falls back to a combination
|
|
16
|
+
of the current time and the process identifier.
|
|
17
|
+
"""
|
|
18
|
+
...
|
|
19
|
+
def getstate(self) -> _State:
|
|
20
|
+
"""getstate() -> tuple containing the current state."""
|
|
21
|
+
...
|
|
22
|
+
def setstate(self, state: _State, /) -> None:
|
|
23
|
+
"""setstate(state) -> None. Restores generator state."""
|
|
24
|
+
...
|
|
25
|
+
def random(self) -> float:
|
|
26
|
+
"""random() -> x in the interval [0, 1)."""
|
|
27
|
+
...
|
|
28
|
+
def getrandbits(self, k: int, /) -> int:
|
|
29
|
+
"""getrandbits(k) -> x. Generates an int with k random bits."""
|
|
30
|
+
...
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
from collections.abc import Callable
|
|
2
3
|
from typing import Any, ClassVar, Literal, final
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
3
5
|
|
|
4
6
|
# _tkinter is meant to be only used internally by tkinter, but some tkinter
|
|
5
7
|
# functions e.g. return _tkinter.Tcl_Obj objects. Tcl_Obj represents a Tcl
|
|
@@ -46,6 +48,8 @@ class Tcl_Obj:
|
|
|
46
48
|
|
|
47
49
|
class TclError(Exception): ...
|
|
48
50
|
|
|
51
|
+
_TkinterTraceFunc: TypeAlias = Callable[[tuple[str, ...]], object]
|
|
52
|
+
|
|
49
53
|
# This class allows running Tcl code. Tkinter uses it internally a lot, and
|
|
50
54
|
# it's often handy to drop a piece of Tcl code into a tkinter program. Example:
|
|
51
55
|
#
|
|
@@ -102,6 +106,9 @@ class TkappType:
|
|
|
102
106
|
def unsetvar(self, *args, **kwargs): ...
|
|
103
107
|
def wantobjects(self, *args, **kwargs): ...
|
|
104
108
|
def willdispatch(self): ...
|
|
109
|
+
if sys.version_info >= (3, 12):
|
|
110
|
+
def gettrace(self, /) -> _TkinterTraceFunc | None: ...
|
|
111
|
+
def settrace(self, func: _TkinterTraceFunc | None, /) -> None: ...
|
|
105
112
|
|
|
106
113
|
# These should be kept in sync with tkinter.tix constants, except ALL_EVENTS which doesn't match TCL_ALL_EVENTS
|
|
107
114
|
ALL_EVENTS: Literal[-3]
|
|
@@ -27,8 +27,9 @@ class ProxyType(Generic[_T]): # "weakproxy"
|
|
|
27
27
|
def __getattr__(self, attr: str) -> Any: ...
|
|
28
28
|
|
|
29
29
|
class ReferenceType(Generic[_T]):
|
|
30
|
-
__callback__: Callable[[
|
|
31
|
-
def __new__(cls, o: _T, callback: Callable[[
|
|
30
|
+
__callback__: Callable[[Self], Any]
|
|
31
|
+
def __new__(cls, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> Self: ...
|
|
32
|
+
def __init__(self, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> None: ...
|
|
32
33
|
def __call__(self) -> _T | None:
|
|
33
34
|
"""Call self as a function."""
|
|
34
35
|
...
|
|
@@ -32,6 +32,7 @@ _T = TypeVar("_T")
|
|
|
32
32
|
_ActionT = TypeVar("_ActionT", bound=Action)
|
|
33
33
|
_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser)
|
|
34
34
|
_N = TypeVar("_N")
|
|
35
|
+
_ActionType: TypeAlias = Callable[[str], Any] | FileType | str
|
|
35
36
|
# more precisely, Literal["store", "store_const", "store_true",
|
|
36
37
|
# "store_false", "append", "append_const", "count", "help", "version",
|
|
37
38
|
# "extend"], but using this would make it hard to annotate callers
|
|
@@ -89,7 +90,7 @@ class _ActionsContainer:
|
|
|
89
90
|
nargs: int | _NArgsStr | _SUPPRESS_T | None = None,
|
|
90
91
|
const: Any = ...,
|
|
91
92
|
default: Any = ...,
|
|
92
|
-
type:
|
|
93
|
+
type: _ActionType = ...,
|
|
93
94
|
choices: Iterable[_T] | None = ...,
|
|
94
95
|
required: bool = ...,
|
|
95
96
|
help: str | None = ...,
|
|
@@ -313,7 +314,7 @@ class Action(_AttributeHolder):
|
|
|
313
314
|
nargs: int | str | None
|
|
314
315
|
const: Any
|
|
315
316
|
default: Any
|
|
316
|
-
type:
|
|
317
|
+
type: _ActionType | None
|
|
317
318
|
choices: Iterable[Any] | None
|
|
318
319
|
required: bool
|
|
319
320
|
help: str | None
|
|
@@ -699,6 +700,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
|
|
699
700
|
add_help: bool = ...,
|
|
700
701
|
allow_abbrev: bool = ...,
|
|
701
702
|
exit_on_error: bool = ...,
|
|
703
|
+
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
|
702
704
|
) -> _ArgumentParserT: ...
|
|
703
705
|
elif sys.version_info >= (3, 9):
|
|
704
706
|
def add_parser(
|
|
@@ -721,6 +723,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
|
|
721
723
|
add_help: bool = ...,
|
|
722
724
|
allow_abbrev: bool = ...,
|
|
723
725
|
exit_on_error: bool = ...,
|
|
726
|
+
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
|
724
727
|
) -> _ArgumentParserT: ...
|
|
725
728
|
else:
|
|
726
729
|
def add_parser(
|
|
@@ -742,6 +745,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
|
|
742
745
|
conflict_handler: str = ...,
|
|
743
746
|
add_help: bool = ...,
|
|
744
747
|
allow_abbrev: bool = ...,
|
|
748
|
+
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
|
745
749
|
) -> _ArgumentParserT: ...
|
|
746
750
|
|
|
747
751
|
def _get_subactions(self) -> list[Action]: ...
|