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.
Files changed (148) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/commit.txt +1 -1
  6. package/dist/typeshed-fallback/stdlib/VERSIONS +3 -1
  7. package/dist/typeshed-fallback/stdlib/_ast.pyi +1 -1
  8. package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +1 -2
  11. package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
  12. package/dist/typeshed-fallback/stdlib/_interpchannels.pyi +84 -0
  13. package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
  14. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
  15. package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
  16. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +7 -0
  17. package/dist/typeshed-fallback/stdlib/_weakref.pyi +3 -2
  18. package/dist/typeshed-fallback/stdlib/argparse.pyi +6 -2
  19. package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
  20. package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +56 -37
  21. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +4 -1
  22. package/dist/typeshed-fallback/stdlib/asyncio/unix_events.pyi +156 -134
  23. package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +3 -2
  24. package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
  25. package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
  26. package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
  27. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +1 -1
  28. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +2 -5
  29. package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
  30. package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -154
  31. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +10 -6
  32. package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +33 -12
  33. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +10 -10
  34. package/dist/typeshed-fallback/stdlib/posixpath.pyi +3 -13
  35. package/dist/typeshed-fallback/stdlib/spwd.pyi +9 -0
  36. package/dist/typeshed-fallback/stdlib/subprocess.pyi +8 -0
  37. package/dist/typeshed-fallback/stdlib/tarfile.pyi +23 -1
  38. package/dist/typeshed-fallback/stdlib/telnetlib.pyi +1 -0
  39. package/dist/typeshed-fallback/stdlib/typing.pyi +21 -2
  40. package/dist/typeshed-fallback/stdlib/weakref.pyi +4 -1
  41. package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +1 -1
  42. package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
  43. package/dist/typeshed-fallback/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +4 -4
  44. package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
  45. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +6 -20
  46. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +2 -0
  47. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +5 -3
  48. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/__init__.pyi +143 -79
  49. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +5 -5
  50. package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +7 -1
  51. package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +8 -0
  52. package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +2 -2
  53. package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +3 -2
  54. package/dist/typeshed-fallback/stubs/docker/docker/api/network.pyi +32 -15
  55. package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +36 -7
  56. package/dist/typeshed-fallback/stubs/docker/docker/models/images.pyi +67 -5
  57. package/dist/typeshed-fallback/stubs/docker/docker/models/networks.pyi +20 -3
  58. package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +78 -70
  59. package/dist/typeshed-fallback/stubs/docker/docker/utils/json_stream.pyi +4 -7
  60. package/dist/typeshed-fallback/stubs/flake8/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +16 -5
  62. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/image_datastructures.pyi +2 -1
  63. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/table.pyi +4 -2
  64. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/text_region.pyi +7 -7
  65. package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
  66. package/dist/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +1 -0
  67. package/dist/typeshed-fallback/stubs/hvac/METADATA.toml +1 -1
  68. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/raft.pyi +9 -0
  69. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/wrapping.pyi +1 -0
  70. package/dist/typeshed-fallback/stubs/influxdb-client/METADATA.toml +1 -1
  71. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_pages.pyi +37 -0
  72. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi +5 -1
  73. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi +4 -3
  74. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi +6 -6
  75. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi +6 -6
  76. package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +3 -1
  77. package/dist/typeshed-fallback/stubs/olefile/olefile/olefile.pyi +41 -31
  78. package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
  79. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/rich_text.pyi +3 -0
  80. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +1 -2
  81. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +1 -1
  82. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/container.pyi +18 -0
  83. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +20 -12
  84. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi +1 -1
  85. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +2 -2
  86. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +6 -11
  87. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +66 -135
  88. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +2 -2
  89. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +0 -1
  90. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +0 -2
  91. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +3 -3
  92. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +5 -10
  93. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +2 -2
  94. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi +2 -2
  95. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +2 -2
  96. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +11 -3
  97. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +2 -2
  98. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +6 -3
  99. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +26 -22
  100. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +3 -5
  101. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +5 -2
  102. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +4 -2
  103. package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
  104. package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +6 -1
  105. package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
  106. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +84 -15
  107. package/dist/typeshed-fallback/stubs/psutil/METADATA.toml +1 -1
  108. package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +3 -1
  109. package/dist/typeshed-fallback/stubs/psutil/psutil/_common.pyi +0 -2
  110. package/dist/typeshed-fallback/stubs/psutil/psutil/_compat.pyi +0 -1
  111. package/dist/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi +1 -1
  112. package/dist/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +1 -1
  113. package/dist/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +2 -2
  114. package/dist/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi +1 -1
  116. package/dist/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi +1 -1
  117. package/dist/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +1 -1
  118. package/dist/typeshed-fallback/stubs/pyinstaller/METADATA.toml +1 -1
  119. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi +1 -0
  120. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +0 -2
  121. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi +2 -3
  122. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +3 -2
  123. package/dist/typeshed-fallback/stubs/requests/requests/models.pyi +2 -2
  124. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +2 -1
  125. package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
  126. package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +80 -50
  127. package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +2 -4
  128. package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +6 -3
  129. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +3 -9
  130. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +61 -0
  131. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -2
  132. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +12 -1
  133. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +1 -1
  134. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +4 -4
  135. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +3 -4
  136. package/dist/typeshed-fallback/stubs/setuptools/setuptools/compat/py311.pyi +1 -1
  137. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +0 -1
  138. package/dist/typeshed-fallback/stubs/shapely/METADATA.toml +2 -1
  139. package/dist/typeshed-fallback/stubs/shapely/shapely/_geometry.pyi +3 -3
  140. package/dist/typeshed-fallback/stubs/shapely/shapely/constructive.pyi +6 -6
  141. package/dist/typeshed-fallback/stubs/shapely/shapely/geometry/base.pyi +3 -3
  142. package/dist/typeshed-fallback/stubs/shapely/shapely/io.pyi +2 -2
  143. package/dist/typeshed-fallback/stubs/shapely/shapely/strtree.pyi +9 -9
  144. package/dist/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml +1 -1
  145. package/package.json +1 -1
  146. package/dist/typeshed-fallback/stubs/tree-sitter/METADATA.toml +0 -7
  147. package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi +0 -17
  148. 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[[ReferenceType[_T]], Any]
31
- def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
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: Callable[[str], _T] | FileType = ...,
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: Callable[[str], Any] | FileType | None
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]: ...