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.
Files changed (171) 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/_csv.pyi +4 -3
  7. package/dist/typeshed-fallback/stdlib/_frozen_importlib.pyi +1 -1
  8. package/dist/typeshed-fallback/stdlib/_frozen_importlib_external.pyi +5 -5
  9. package/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi +3 -0
  10. package/dist/typeshed-fallback/stdlib/ast.pyi +29 -10
  11. package/dist/typeshed-fallback/stdlib/builtins.pyi +79 -62
  12. package/dist/typeshed-fallback/stdlib/cmath.pyi +1 -1
  13. package/dist/typeshed-fallback/stdlib/copy.pyi +6 -6
  14. package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +2 -2
  15. package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +1 -1
  16. package/dist/typeshed-fallback/stdlib/html/parser.pyi +4 -9
  17. package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +3 -3
  18. package/dist/typeshed-fallback/stdlib/importlib/resources/__init__.pyi +6 -2
  19. package/dist/typeshed-fallback/stdlib/importlib/resources/_functional.pyi +2 -1
  20. package/dist/typeshed-fallback/stdlib/operator.pyi +4 -2
  21. package/dist/typeshed-fallback/stdlib/pdb.pyi +5 -0
  22. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +160 -69
  23. package/dist/typeshed-fallback/stdlib/turtle.pyi +18 -14
  24. package/dist/typeshed-fallback/stdlib/types.pyi +21 -16
  25. package/dist/typeshed-fallback/stdlib/typing.pyi +12 -2
  26. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +2 -1
  27. package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +15 -15
  28. package/dist/typeshed-fallback/stdlib/xxlimited.pyi +16 -3
  29. package/dist/typeshed-fallback/stubs/Authlib/METADATA.toml +1 -1
  30. package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7515/jws.pyi +3 -2
  31. package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7516/models.pyi +2 -2
  32. package/dist/typeshed-fallback/stubs/Authlib/authlib/jose/rfc7518/jwe_zips.pyi +7 -2
  33. package/dist/typeshed-fallback/stubs/Authlib/authlib/oauth2/rfc7591/endpoint.pyi +6 -4
  34. package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/constants.pyi +22 -0
  35. package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi +2 -21
  36. package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi +11 -0
  37. package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi +22 -3
  38. package/dist/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pinmux_lookup.pyi +6 -0
  39. package/dist/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml +1 -1
  40. package/dist/typeshed-fallback/stubs/PySocks/sockshandler.pyi +0 -5
  41. package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
  42. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +2 -0
  43. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +1 -1
  44. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +15 -4
  45. package/dist/typeshed-fallback/stubs/braintree/METADATA.toml +1 -1
  46. package/dist/typeshed-fallback/stubs/braintree/braintree/__init__.pyi +11 -0
  47. package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_gateway.pyi +13 -0
  48. package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_jwt.pyi +8 -0
  49. package/dist/typeshed-fallback/stubs/braintree/braintree/bank_account_instant_verification_jwt_request.pyi +18 -0
  50. package/dist/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi +4 -3
  51. package/dist/typeshed-fallback/stubs/braintree/braintree/error_codes.pyi +2 -0
  52. package/dist/typeshed-fallback/stubs/braintree/braintree/receiver.pyi +6 -0
  53. package/dist/typeshed-fallback/stubs/braintree/braintree/sender.pyi +6 -0
  54. package/dist/typeshed-fallback/stubs/braintree/braintree/transaction_us_bank_account_request.pyi +17 -0
  55. package/dist/typeshed-fallback/stubs/braintree/braintree/transfer.pyi +4 -0
  56. package/dist/typeshed-fallback/stubs/braintree/braintree/us_bank_account_verification.pyi +1 -0
  57. package/dist/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi +36 -5
  58. package/dist/typeshed-fallback/stubs/cachetools/cachetools/func.pyi +45 -10
  59. package/dist/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi +2 -2
  60. package/dist/typeshed-fallback/stubs/django-filter/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/django-filter/django_filters/filters.pyi +1 -1
  62. package/dist/typeshed-fallback/stubs/docker/METADATA.toml +1 -1
  63. package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +2 -2
  64. package/dist/typeshed-fallback/stubs/docker/docker/api/swarm.pyi +12 -9
  65. package/dist/typeshed-fallback/stubs/docker/docker/credentials/store.pyi +3 -3
  66. package/dist/typeshed-fallback/stubs/docker/docker/errors.pyi +9 -7
  67. package/dist/typeshed-fallback/stubs/docker/docker/models/services.pyi +4 -6
  68. package/dist/typeshed-fallback/stubs/docker/docker/transport/npipeconn.pyi +16 -16
  69. package/dist/typeshed-fallback/stubs/docker/docker/transport/npipesocket.pyi +40 -32
  70. package/dist/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi +30 -24
  71. package/dist/typeshed-fallback/stubs/docker/docker/transport/unixconn.pyi +22 -19
  72. package/dist/typeshed-fallback/stubs/docker/docker/types/networks.pyi +1 -1
  73. package/dist/typeshed-fallback/stubs/docker/docker/types/services.pyi +16 -10
  74. package/dist/typeshed-fallback/stubs/docker/docker/types/swarm.pyi +2 -7
  75. package/dist/typeshed-fallback/stubs/docker/docker/utils/decorators.pyi +8 -4
  76. package/dist/typeshed-fallback/stubs/docker/docker/utils/utils.pyi +4 -4
  77. package/dist/typeshed-fallback/stubs/docutils/docutils/nodes.pyi +2 -2
  78. package/dist/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml +1 -1
  79. package/dist/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml +1 -1
  80. package/dist/typeshed-fallback/stubs/grpcio/grpc/__init__.pyi +32 -34
  81. package/dist/typeshed-fallback/stubs/grpcio/grpc/aio/__init__.pyi +40 -21
  82. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/app/base.pyi +0 -3
  83. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/app/wsgiapp.pyi +0 -4
  84. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi +1 -2
  85. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi +1 -2
  86. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/message.pyi +0 -3
  87. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/unreader.pyi +0 -3
  88. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi +0 -2
  89. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/instrument/statsd.pyi +0 -9
  90. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/reloader.pyi +1 -3
  91. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/sock.pyi +0 -3
  92. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/geventlet.pyi +1 -8
  93. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/ggevent.pyi +0 -9
  94. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gtornado.pyi +1 -4
  95. package/dist/typeshed-fallback/stubs/gunicorn/gunicorn/workers/sync.pyi +0 -3
  96. package/dist/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi +5 -5
  97. package/dist/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi +1 -1
  98. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi +4 -2
  99. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi +2 -1
  100. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi +1 -1
  101. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi +2 -2
  102. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi +11 -9
  103. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi +1 -1
  104. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/quality.pyi +1 -1
  105. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +1 -1
  106. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/utils.pyi +3 -2
  107. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/d_separation.pyi +1 -1
  108. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi +2 -2
  109. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/efficiency_measures.pyi +4 -4
  110. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi +3 -1
  111. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/utils.pyi +10 -3
  112. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/hierarchy.pyi +3 -1
  113. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/binary.pyi +1 -1
  114. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/product.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi +1 -1
  116. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/branchings.pyi +2 -2
  117. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/decomposition.pyi +2 -2
  118. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/mst.pyi +3 -2
  119. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/wiener.pyi +2 -2
  120. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi +26 -19
  121. package/dist/typeshed-fallback/stubs/networkx/networkx/convert_matrix.pyi +1 -1
  122. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/ego.pyi +2 -1
  123. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/geometric.pyi +2 -2
  124. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/line.pyi +3 -2
  125. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/mycielski.pyi +2 -1
  126. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/spectral_graph_forge.pyi +2 -3
  127. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/stochastic.pyi +3 -1
  128. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi +3 -2
  129. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi +8 -3
  130. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi +9 -8
  131. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi +3 -2
  132. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/graph6.pyi +2 -2
  133. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi +10 -9
  134. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi +2 -1
  135. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi +2 -1
  136. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +22 -1
  137. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/tree.pyi +3 -1
  138. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi +3 -2
  139. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/p2g.pyi +3 -3
  140. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi +3 -2
  141. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/sparse6.pyi +3 -4
  142. package/dist/typeshed-fallback/stubs/networkx/networkx/utils/backends.pyi +1 -1
  143. package/dist/typeshed-fallback/stubs/networkx/networkx/utils/misc.pyi +2 -1
  144. package/dist/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi +2 -2
  145. package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +11 -4
  146. package/dist/typeshed-fallback/stubs/psycopg2/METADATA.toml +1 -1
  147. package/dist/typeshed-fallback/stubs/psycopg2/psycopg2/errorcodes.pyi +3 -0
  148. package/dist/typeshed-fallback/stubs/pyserial/serial/rfc2217.pyi +2 -2
  149. package/dist/typeshed-fallback/stubs/pyserial/serial/serialutil.pyi +1 -1
  150. package/dist/typeshed-fallback/stubs/pyserial/serial/tools/list_ports.pyi +3 -1
  151. package/dist/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_windows.pyi +1 -1
  152. package/dist/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_spy.pyi +2 -2
  153. package/dist/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi +30 -1
  154. package/dist/typeshed-fallback/stubs/pywin32/win32/win32pipe.pyi +1 -1
  155. package/dist/typeshed-fallback/stubs/six/six/__init__.pyi +1 -1
  156. package/dist/typeshed-fallback/stubs/www-authenticate/METADATA.toml +2 -0
  157. package/dist/typeshed-fallback/stubs/www-authenticate/www_authenticate.pyi +34 -0
  158. package/dist/typeshed-fallback/stubs/xlrd/xlrd/sheet.pyi +5 -5
  159. package/dist/typeshed-fallback/stubs/xmldiff/METADATA.toml +2 -0
  160. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/__init__.pyi +0 -0
  161. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/actions.pyi +58 -0
  162. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/diff.pyi +36 -0
  163. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/diff_match_patch.pyi +58 -0
  164. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/formatting.pyi +80 -0
  165. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/main.pyi +70 -0
  166. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/patch.pyi +12 -0
  167. package/dist/typeshed-fallback/stubs/xmldiff/xmldiff/utils.pyi +16 -0
  168. package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/common.pyi +48 -32
  169. package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/commonmistakes.pyi +5 -3
  170. package/dist/typeshed-fallback/stubs/yt-dlp/yt_dlp/extractor/commonprotocols.pyi +5 -3
  171. package/package.json +1 -1
@@ -69,7 +69,7 @@ def isinf(z: _C, /) -> bool:
69
69
  def isnan(z: _C, /) -> bool:
70
70
  """Checks if the real or imaginary part of z not a number (NaN)."""
71
71
  ...
72
- def log(x: _C, base: _C = ..., /) -> complex:
72
+ def log(z: _C, base: _C = ..., /) -> complex:
73
73
  """
74
74
  log(z[, base]) -> the logarithm of z to the given base.
75
75
 
@@ -1,16 +1,15 @@
1
1
  import sys
2
2
  from typing import Any, Protocol, TypeVar, type_check_only
3
- from typing_extensions import Self
4
3
 
5
4
  __all__ = ["Error", "copy", "deepcopy"]
6
5
 
7
6
  _T = TypeVar("_T")
8
- _SR = TypeVar("_SR", bound=_SupportsReplace)
7
+ _RT_co = TypeVar("_RT_co", covariant=True)
9
8
 
10
9
  @type_check_only
11
- class _SupportsReplace(Protocol):
12
- # In reality doesn't support args, but there's no other great way to express this.
13
- def __replace__(self, *args: Any, **kwargs: Any) -> Self: ...
10
+ class _SupportsReplace(Protocol[_RT_co]):
11
+ # In reality doesn't support args, but there's no great way to express this.
12
+ def __replace__(self, /, *_: Any, **changes: Any) -> _RT_co: ...
14
13
 
15
14
  # None in CPython but non-None in Jython
16
15
  PyStringMap: Any
@@ -21,7 +20,8 @@ def copy(x: _T) -> _T: ...
21
20
 
22
21
  if sys.version_info >= (3, 13):
23
22
  __all__ += ["replace"]
24
- def replace(obj: _SR, /, **changes: Any) -> _SR: ...
23
+ # The types accepted by `**changes` match those of `obj.__replace__`.
24
+ def replace(obj: _SupportsReplace[_RT_co], /, **changes: Any) -> _RT_co: ...
25
25
 
26
26
  class Error(Exception): ...
27
27
 
@@ -23,7 +23,7 @@ from _ctypes import (
23
23
  set_errno as set_errno,
24
24
  sizeof as sizeof,
25
25
  )
26
- from _typeshed import StrPath
26
+ from _typeshed import StrPath, SupportsBool, SupportsLen
27
27
  from ctypes._endian import BigEndianStructure as BigEndianStructure, LittleEndianStructure as LittleEndianStructure
28
28
  from types import GenericAlias
29
29
  from typing import Any, ClassVar, Final, Generic, Literal, TypeVar, overload, type_check_only
@@ -229,7 +229,7 @@ class py_object(_CanCastTo, _SimpleCData[_T]):
229
229
 
230
230
  class c_bool(_SimpleCData[bool]):
231
231
  _type_: ClassVar[Literal["?"]]
232
- def __init__(self, value: bool = ...) -> None: ...
232
+ def __init__(self, value: SupportsBool | SupportsLen | None = ...) -> None: ...
233
233
 
234
234
  class c_byte(_SimpleCData[int]):
235
235
  _type_: ClassVar[Literal["b"]]
@@ -41,7 +41,7 @@ class DateHeader:
41
41
  max_count: ClassVar[Literal[1] | None]
42
42
  def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], datetime: _datetime) -> None: ...
43
43
  @property
44
- def datetime(self) -> _datetime: ...
44
+ def datetime(self) -> _datetime | None: ...
45
45
  @staticmethod
46
46
  def value_parser(value: str) -> UnstructuredTokenList: ...
47
47
  @classmethod
@@ -1,4 +1,3 @@
1
- import sys
2
1
  from _markupbase import ParserBase
3
2
  from re import Pattern
4
3
  from typing import Final
@@ -7,9 +6,8 @@ __all__ = ["HTMLParser"]
7
6
 
8
7
  class HTMLParser(ParserBase):
9
8
  CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
10
- if sys.version_info >= (3, 13):
11
- # Added in 3.13.6
12
- RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
9
+ # Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.6
10
+ RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
13
11
 
14
12
  def __init__(self, *, convert_charrefs: bool = True) -> None: ...
15
13
  def feed(self, data: str) -> None: ...
@@ -32,11 +30,8 @@ class HTMLParser(ParserBase):
32
30
  def parse_html_declaration(self, i: int) -> int: ... # undocumented
33
31
  def parse_pi(self, i: int) -> int: ... # undocumented
34
32
  def parse_starttag(self, i: int) -> int: ... # undocumented
35
- if sys.version_info >= (3, 13):
36
- # `escapable` parameter added in 3.13.6
37
- def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented
38
- else:
39
- def set_cdata_mode(self, elem: str) -> None: ... # undocumented
33
+ # `escapable` parameter added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.6
34
+ def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented
40
35
  rawdata: str # undocumented
41
36
  cdata_elem: str | None # undocumented
42
37
  convert_charrefs: bool # undocumented
@@ -53,7 +53,7 @@ class InspectLoader(Loader):
53
53
  def exec_module(self, module: types.ModuleType) -> None: ...
54
54
  @staticmethod
55
55
  def source_to_code(
56
- data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath = "<string>"
56
+ data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: bytes | StrPath = "<string>"
57
57
  ) -> types.CodeType: ...
58
58
 
59
59
  class ExecutionLoader(InspectLoader):
@@ -114,8 +114,8 @@ class FileLoader(_bootstrap_external.FileLoader, ResourceLoader, ExecutionLoader
114
114
  path: str
115
115
  def __init__(self, fullname: str, path: str) -> None: ...
116
116
  def get_data(self, path: str) -> bytes: ...
117
- def get_filename(self, name: str | None = None) -> str: ...
118
- def load_module(self, name: str | None = None) -> types.ModuleType: ...
117
+ def get_filename(self, fullname: str | None = None) -> str: ...
118
+ def load_module(self, fullname: str | None = None) -> types.ModuleType: ...
119
119
 
120
120
  if sys.version_info < (3, 11):
121
121
  class ResourceReader(metaclass=ABCMeta):
@@ -5,7 +5,7 @@ from contextlib import AbstractContextManager
5
5
  from pathlib import Path
6
6
  from types import ModuleType
7
7
  from typing import Any, BinaryIO, Literal, TextIO
8
- from typing_extensions import TypeAlias
8
+ from typing_extensions import TypeAlias, deprecated
9
9
 
10
10
  if sys.version_info >= (3, 11):
11
11
  from importlib.resources.abc import Traversable
@@ -64,7 +64,11 @@ else:
64
64
  def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ...
65
65
  def path(package: Package, resource: Resource) -> AbstractContextManager[Path, Literal[False]]: ...
66
66
  def is_resource(package: Package, name: str) -> bool: ...
67
- def contents(package: Package) -> Iterator[str]: ...
67
+ if sys.version_info >= (3, 11):
68
+ @deprecated("Deprecated since Python 3.11. Use `files(anchor).iterdir()`.")
69
+ def contents(package: Package) -> Iterator[str]: ...
70
+ else:
71
+ def contents(package: Package) -> Iterator[str]: ...
68
72
 
69
73
  if sys.version_info >= (3, 11):
70
74
  from importlib.resources._common import as_file as as_file
@@ -9,7 +9,7 @@ if sys.version_info >= (3, 13):
9
9
  from io import TextIOWrapper
10
10
  from pathlib import Path
11
11
  from typing import BinaryIO, Literal, overload
12
- from typing_extensions import Unpack
12
+ from typing_extensions import Unpack, deprecated
13
13
 
14
14
  def open_binary(anchor: Anchor, *path_names: StrPath) -> BinaryIO: ...
15
15
  @overload
@@ -27,4 +27,5 @@ if sys.version_info >= (3, 13):
27
27
  def read_text(anchor: Anchor, *path_names: StrPath, encoding: str | None, errors: str | None = "strict") -> str: ...
28
28
  def path(anchor: Anchor, *path_names: StrPath) -> AbstractContextManager[Path, Literal[False]]: ...
29
29
  def is_resource(anchor: Anchor, *path_names: StrPath) -> bool: ...
30
+ @deprecated("Deprecated since Python 3.11. Use `files(anchor).iterdir()`.")
30
31
  def contents(anchor: Anchor, *path_names: StrPath) -> Iterator[str]: ...
@@ -207,8 +207,10 @@ class itemgetter(Generic[_T_co]):
207
207
  # "tuple[int, int]" is incompatible with protocol "SupportsIndex"
208
208
  # preventing [_T_co, ...] instead of [Any, ...]
209
209
  #
210
- # A suspected mypy issue prevents using [..., _T] instead of [..., Any] here.
211
- # https://github.com/python/mypy/issues/14032
210
+ # If we can't infer a literal key from __new__ (ie: `itemgetter[Literal[0]]` for `itemgetter(0)`),
211
+ # then we can't annotate __call__'s return type or it'll break on tuples
212
+ #
213
+ # These issues are best demonstrated by the `itertools.check_itertools_recipes.unique_justseen` test.
212
214
  def __call__(self, obj: SupportsGetItem[Any, Any]) -> Any:
213
215
  """Call self as a function."""
214
216
  ...
@@ -5,6 +5,7 @@ from cmd import Cmd
5
5
  from collections.abc import Callable, Iterable, Mapping, Sequence
6
6
  from inspect import _SourceObjectType
7
7
  from linecache import _ModuleGlobals
8
+ from rlcompleter import Completer
8
9
  from types import CodeType, FrameType, TracebackType
9
10
  from typing import IO, Any, ClassVar, Final, Literal, TypeVar
10
11
  from typing_extensions import ParamSpec, Self, TypeAlias
@@ -200,6 +201,10 @@ class Pdb(Bdb, Cmd):
200
201
  def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
201
202
  if sys.version_info >= (3, 12):
202
203
  def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ...
204
+ if sys.version_info >= (3, 13) and sys.version_info < (3, 14):
205
+ # Added in 3.13.8.
206
+ @property
207
+ def rlcompleter(self) -> type[Completer]: ...
203
208
 
204
209
  def _select_frame(self, number: int) -> None: ...
205
210
  def _getval_except(self, arg: str, frame: FrameType | None = None) -> object: ...
@@ -466,7 +466,7 @@ class Misc:
466
466
  def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ...
467
467
  def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ...
468
468
  def winfo_cells(self) -> int: ...
469
- def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk
469
+ def winfo_children(self) -> list[Widget | Toplevel]: ...
470
470
  def winfo_class(self) -> str: ...
471
471
  def winfo_colormapfull(self) -> bool: ...
472
472
  def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ...
@@ -3153,7 +3153,6 @@ class Scrollbar(Widget):
3153
3153
  def get(self) -> tuple[float, float, float, float] | tuple[float, float]: ...
3154
3154
  def set(self, first: float | str, last: float | str) -> None: ...
3155
3155
 
3156
- _TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc
3157
3156
  _WhatToCount: TypeAlias = Literal[
3158
3157
  "chars", "displaychars", "displayindices", "displaylines", "indices", "lines", "xpixels", "ypixels"
3159
3158
  ]
@@ -3269,20 +3268,37 @@ class Text(Widget, XView, YView):
3269
3268
  @overload
3270
3269
  def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
3271
3270
  config = configure
3272
- def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
3273
- def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ...
3271
+ def bbox(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
3272
+ def compare(
3273
+ self,
3274
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3275
+ op: Literal["<", "<=", "==", ">=", ">", "!="],
3276
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3277
+ ) -> bool: ...
3274
3278
  if sys.version_info >= (3, 13):
3275
3279
  @overload
3276
- def count(self, index1: _TextIndex, index2: _TextIndex, *, return_ints: Literal[True]) -> int: ...
3280
+ def count(
3281
+ self,
3282
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3283
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3284
+ *,
3285
+ return_ints: Literal[True],
3286
+ ) -> int: ...
3277
3287
  @overload
3278
3288
  def count(
3279
- self, index1: _TextIndex, index2: _TextIndex, arg: _WhatToCount | Literal["update"], /, *, return_ints: Literal[True]
3289
+ self,
3290
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3291
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3292
+ arg: _WhatToCount | Literal["update"],
3293
+ /,
3294
+ *,
3295
+ return_ints: Literal[True],
3280
3296
  ) -> int: ...
3281
3297
  @overload
3282
3298
  def count(
3283
3299
  self,
3284
- index1: _TextIndex,
3285
- index2: _TextIndex,
3300
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3301
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3286
3302
  arg1: Literal["update"],
3287
3303
  arg2: _WhatToCount,
3288
3304
  /,
@@ -3292,8 +3308,8 @@ class Text(Widget, XView, YView):
3292
3308
  @overload
3293
3309
  def count(
3294
3310
  self,
3295
- index1: _TextIndex,
3296
- index2: _TextIndex,
3311
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3312
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3297
3313
  arg1: _WhatToCount,
3298
3314
  arg2: Literal["update"],
3299
3315
  /,
@@ -3302,13 +3318,20 @@ class Text(Widget, XView, YView):
3302
3318
  ) -> int: ...
3303
3319
  @overload
3304
3320
  def count(
3305
- self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: _WhatToCount, /, *, return_ints: Literal[True]
3321
+ self,
3322
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3323
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3324
+ arg1: _WhatToCount,
3325
+ arg2: _WhatToCount,
3326
+ /,
3327
+ *,
3328
+ return_ints: Literal[True],
3306
3329
  ) -> tuple[int, int]: ...
3307
3330
  @overload
3308
3331
  def count(
3309
3332
  self,
3310
- index1: _TextIndex,
3311
- index2: _TextIndex,
3333
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3334
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3312
3335
  arg1: _WhatToCount | Literal["update"],
3313
3336
  arg2: _WhatToCount | Literal["update"],
3314
3337
  arg3: _WhatToCount | Literal["update"],
@@ -3317,12 +3340,18 @@ class Text(Widget, XView, YView):
3317
3340
  return_ints: Literal[True],
3318
3341
  ) -> tuple[int, ...]: ...
3319
3342
  @overload
3320
- def count(self, index1: _TextIndex, index2: _TextIndex, *, return_ints: Literal[False] = False) -> tuple[int] | None: ...
3343
+ def count(
3344
+ self,
3345
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3346
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3347
+ *,
3348
+ return_ints: Literal[False] = False,
3349
+ ) -> tuple[int] | None: ...
3321
3350
  @overload
3322
3351
  def count(
3323
3352
  self,
3324
- index1: _TextIndex,
3325
- index2: _TextIndex,
3353
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3354
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3326
3355
  arg: _WhatToCount | Literal["update"],
3327
3356
  /,
3328
3357
  *,
@@ -3331,8 +3360,8 @@ class Text(Widget, XView, YView):
3331
3360
  @overload
3332
3361
  def count(
3333
3362
  self,
3334
- index1: _TextIndex,
3335
- index2: _TextIndex,
3363
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3364
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3336
3365
  arg1: Literal["update"],
3337
3366
  arg2: _WhatToCount,
3338
3367
  /,
@@ -3342,8 +3371,8 @@ class Text(Widget, XView, YView):
3342
3371
  @overload
3343
3372
  def count(
3344
3373
  self,
3345
- index1: _TextIndex,
3346
- index2: _TextIndex,
3374
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3375
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3347
3376
  arg1: _WhatToCount,
3348
3377
  arg2: Literal["update"],
3349
3378
  /,
@@ -3353,8 +3382,8 @@ class Text(Widget, XView, YView):
3353
3382
  @overload
3354
3383
  def count(
3355
3384
  self,
3356
- index1: _TextIndex,
3357
- index2: _TextIndex,
3385
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3386
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3358
3387
  arg1: _WhatToCount,
3359
3388
  arg2: _WhatToCount,
3360
3389
  /,
@@ -3364,8 +3393,8 @@ class Text(Widget, XView, YView):
3364
3393
  @overload
3365
3394
  def count(
3366
3395
  self,
3367
- index1: _TextIndex,
3368
- index2: _TextIndex,
3396
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3397
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3369
3398
  arg1: _WhatToCount | Literal["update"],
3370
3399
  arg2: _WhatToCount | Literal["update"],
3371
3400
  arg3: _WhatToCount | Literal["update"],
@@ -3375,22 +3404,49 @@ class Text(Widget, XView, YView):
3375
3404
  ) -> tuple[int, ...]: ...
3376
3405
  else:
3377
3406
  @overload
3378
- def count(self, index1: _TextIndex, index2: _TextIndex) -> tuple[int] | None: ...
3407
+ def count(
3408
+ self, index1: str | float | _tkinter.Tcl_Obj | Widget, index2: str | float | _tkinter.Tcl_Obj | Widget
3409
+ ) -> tuple[int] | None: ...
3379
3410
  @overload
3380
3411
  def count(
3381
- self, index1: _TextIndex, index2: _TextIndex, arg: _WhatToCount | Literal["update"], /
3412
+ self,
3413
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3414
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3415
+ arg: _WhatToCount | Literal["update"],
3416
+ /,
3382
3417
  ) -> tuple[int] | None: ...
3383
3418
  @overload
3384
- def count(self, index1: _TextIndex, index2: _TextIndex, arg1: Literal["update"], arg2: _WhatToCount, /) -> int | None: ...
3419
+ def count(
3420
+ self,
3421
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3422
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3423
+ arg1: Literal["update"],
3424
+ arg2: _WhatToCount,
3425
+ /,
3426
+ ) -> int | None: ...
3385
3427
  @overload
3386
- def count(self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: Literal["update"], /) -> int | None: ...
3428
+ def count(
3429
+ self,
3430
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3431
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3432
+ arg1: _WhatToCount,
3433
+ arg2: Literal["update"],
3434
+ /,
3435
+ ) -> int | None: ...
3387
3436
  @overload
3388
- def count(self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: _WhatToCount, /) -> tuple[int, int]: ...
3437
+ def count(
3438
+ self,
3439
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3440
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3441
+ arg1: _WhatToCount,
3442
+ arg2: _WhatToCount,
3443
+ /,
3444
+ ) -> tuple[int, int]: ...
3389
3445
  @overload
3390
3446
  def count(
3391
3447
  self,
3392
- index1: _TextIndex,
3393
- index2: _TextIndex,
3448
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3449
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3394
3450
  arg1: _WhatToCount | Literal["update"],
3395
3451
  arg2: _WhatToCount | Literal["update"],
3396
3452
  arg3: _WhatToCount | Literal["update"],
@@ -3402,13 +3458,15 @@ class Text(Widget, XView, YView):
3402
3458
  def debug(self, boolean: None = None) -> bool: ...
3403
3459
  @overload
3404
3460
  def debug(self, boolean: bool) -> None: ...
3405
- def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ...
3406
- def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ...
3461
+ def delete(
3462
+ self, index1: str | float | _tkinter.Tcl_Obj | Widget, index2: str | float | _tkinter.Tcl_Obj | Widget | None = None
3463
+ ) -> None: ...
3464
+ def dlineinfo(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> tuple[int, int, int, int, int] | None: ...
3407
3465
  @overload
3408
3466
  def dump(
3409
3467
  self,
3410
- index1: _TextIndex,
3411
- index2: _TextIndex | None = None,
3468
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3469
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3412
3470
  command: None = None,
3413
3471
  *,
3414
3472
  all: bool = ...,
@@ -3421,8 +3479,8 @@ class Text(Widget, XView, YView):
3421
3479
  @overload
3422
3480
  def dump(
3423
3481
  self,
3424
- index1: _TextIndex,
3425
- index2: _TextIndex | None,
3482
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3483
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None,
3426
3484
  command: Callable[[str, str, str], object] | str,
3427
3485
  *,
3428
3486
  all: bool = ...,
@@ -3435,8 +3493,8 @@ class Text(Widget, XView, YView):
3435
3493
  @overload
3436
3494
  def dump(
3437
3495
  self,
3438
- index1: _TextIndex,
3439
- index2: _TextIndex | None = None,
3496
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3497
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3440
3498
  *,
3441
3499
  command: Callable[[str, str, str], object] | str,
3442
3500
  all: bool = ...,
@@ -3455,21 +3513,27 @@ class Text(Widget, XView, YView):
3455
3513
  def edit_reset(self) -> None: ... # actually returns empty string
3456
3514
  def edit_separator(self) -> None: ... # actually returns empty string
3457
3515
  def edit_undo(self) -> None: ... # actually returns empty string
3458
- def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ...
3516
+ def get(
3517
+ self, index1: str | float | _tkinter.Tcl_Obj | Widget, index2: str | float | _tkinter.Tcl_Obj | Widget | None = None
3518
+ ) -> str: ...
3459
3519
  @overload
3460
- def image_cget(self, index: _TextIndex, option: Literal["image", "name"]) -> str: ...
3520
+ def image_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["image", "name"]) -> str: ...
3461
3521
  @overload
3462
- def image_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
3522
+ def image_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["padx", "pady"]) -> int: ...
3463
3523
  @overload
3464
- def image_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
3524
+ def image_cget(
3525
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["align"]
3526
+ ) -> Literal["baseline", "bottom", "center", "top"]: ...
3465
3527
  @overload
3466
- def image_cget(self, index: _TextIndex, option: str) -> Any: ...
3528
+ def image_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: str) -> Any: ...
3467
3529
  @overload
3468
- def image_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
3530
+ def image_configure(
3531
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, cnf: str
3532
+ ) -> tuple[str, str, str, str, str | int]: ...
3469
3533
  @overload
3470
3534
  def image_configure(
3471
3535
  self,
3472
- index: _TextIndex,
3536
+ index: str | float | _tkinter.Tcl_Obj | Widget,
3473
3537
  cnf: dict[str, Any] | None = None,
3474
3538
  *,
3475
3539
  align: Literal["baseline", "bottom", "center", "top"] = ...,
@@ -3480,7 +3544,7 @@ class Text(Widget, XView, YView):
3480
3544
  ) -> dict[str, tuple[str, str, str, str, str | int]] | None: ...
3481
3545
  def image_create(
3482
3546
  self,
3483
- index: _TextIndex,
3547
+ index: str | float | _tkinter.Tcl_Obj | Widget,
3484
3548
  cnf: dict[str, Any] | None = {},
3485
3549
  *,
3486
3550
  align: Literal["baseline", "bottom", "center", "top"] = ...,
@@ -3490,28 +3554,36 @@ class Text(Widget, XView, YView):
3490
3554
  pady: float | str = ...,
3491
3555
  ) -> str: ...
3492
3556
  def image_names(self) -> tuple[str, ...]: ...
3493
- def index(self, index: _TextIndex) -> str: ...
3494
- def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ...
3557
+ def index(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> str: ...
3558
+ def insert(
3559
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, chars: str, *args: str | list[str] | tuple[str, ...]
3560
+ ) -> None: ...
3495
3561
  @overload
3496
3562
  def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ...
3497
3563
  @overload
3498
3564
  def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string
3499
3565
  def mark_names(self) -> tuple[str, ...]: ...
3500
- def mark_set(self, markName: str, index: _TextIndex) -> None: ...
3566
+ def mark_set(self, markName: str, index: str | float | _tkinter.Tcl_Obj | Widget) -> None: ...
3501
3567
  def mark_unset(self, *markNames: str) -> None: ...
3502
- def mark_next(self, index: _TextIndex) -> str | None: ...
3503
- def mark_previous(self, index: _TextIndex) -> str | None: ...
3568
+ def mark_next(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> str | None: ...
3569
+ def mark_previous(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> str | None: ...
3504
3570
  # **kw of peer_create is same as the kwargs of Text.__init__
3505
3571
  def peer_create(self, newPathName: str | Text, cnf: dict[str, Any] = {}, **kw) -> None: ...
3506
3572
  def peer_names(self) -> tuple[_tkinter.Tcl_Obj, ...]: ...
3507
- def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ...
3573
+ def replace(
3574
+ self,
3575
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3576
+ index2: str | float | _tkinter.Tcl_Obj | Widget,
3577
+ chars: str,
3578
+ *args: str | list[str] | tuple[str, ...],
3579
+ ) -> None: ...
3508
3580
  def scan_mark(self, x: int, y: int) -> None: ...
3509
3581
  def scan_dragto(self, x: int, y: int) -> None: ...
3510
3582
  def search(
3511
3583
  self,
3512
3584
  pattern: str,
3513
- index: _TextIndex,
3514
- stopindex: _TextIndex | None = None,
3585
+ index: str | float | _tkinter.Tcl_Obj | Widget,
3586
+ stopindex: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3515
3587
  forwards: bool | None = None,
3516
3588
  backwards: bool | None = None,
3517
3589
  exact: bool | None = None,
@@ -3520,8 +3592,10 @@ class Text(Widget, XView, YView):
3520
3592
  count: Variable | None = None,
3521
3593
  elide: bool | None = None,
3522
3594
  ) -> str: ... # returns empty string for not found
3523
- def see(self, index: _TextIndex) -> None: ...
3524
- def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ...
3595
+ def see(self, index: str | float | _tkinter.Tcl_Obj | Widget) -> None: ...
3596
+ def tag_add(
3597
+ self, tagName: str, index1: str | float | _tkinter.Tcl_Obj | Widget, *args: str | float | _tkinter.Tcl_Obj | Widget
3598
+ ) -> None: ...
3525
3599
  # tag_bind stuff is very similar to Canvas
3526
3600
  @overload
3527
3601
  def tag_bind(
@@ -3576,33 +3650,50 @@ class Text(Widget, XView, YView):
3576
3650
  tag_config = tag_configure
3577
3651
  def tag_delete(self, first_tag_name: str, /, *tagNames: str) -> None: ... # error if no tag names given
3578
3652
  def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ...
3579
- def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ...
3653
+ def tag_names(self, index: str | float | _tkinter.Tcl_Obj | Widget | None = None) -> tuple[str, ...]: ...
3580
3654
  def tag_nextrange(
3581
- self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None
3655
+ self,
3656
+ tagName: str,
3657
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3658
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3582
3659
  ) -> tuple[str, str] | tuple[()]: ...
3583
3660
  def tag_prevrange(
3584
- self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None
3661
+ self,
3662
+ tagName: str,
3663
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3664
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3585
3665
  ) -> tuple[str, str] | tuple[()]: ...
3586
3666
  def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ...
3587
3667
  def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ...
3588
3668
  # tag_remove and tag_delete are different
3589
- def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ...
3669
+ def tag_remove(
3670
+ self,
3671
+ tagName: str,
3672
+ index1: str | float | _tkinter.Tcl_Obj | Widget,
3673
+ index2: str | float | _tkinter.Tcl_Obj | Widget | None = None,
3674
+ ) -> None: ...
3590
3675
  @overload
3591
- def window_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
3676
+ def window_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["padx", "pady"]) -> int: ...
3592
3677
  @overload
3593
- def window_cget(self, index: _TextIndex, option: Literal["stretch"]) -> bool: ... # actually returns Literal[0, 1]
3678
+ def window_cget(
3679
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["stretch"]
3680
+ ) -> bool: ... # actually returns Literal[0, 1]
3594
3681
  @overload
3595
- def window_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
3682
+ def window_cget(
3683
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["align"]
3684
+ ) -> Literal["baseline", "bottom", "center", "top"]: ...
3596
3685
  @overload # window is set to a widget, but read as the string name.
3597
- def window_cget(self, index: _TextIndex, option: Literal["create", "window"]) -> str: ...
3686
+ def window_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: Literal["create", "window"]) -> str: ...
3598
3687
  @overload
3599
- def window_cget(self, index: _TextIndex, option: str) -> Any: ...
3688
+ def window_cget(self, index: str | float | _tkinter.Tcl_Obj | Widget, option: str) -> Any: ...
3600
3689
  @overload
3601
- def window_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
3690
+ def window_configure(
3691
+ self, index: str | float | _tkinter.Tcl_Obj | Widget, cnf: str
3692
+ ) -> tuple[str, str, str, str, str | int]: ...
3602
3693
  @overload
3603
3694
  def window_configure(
3604
3695
  self,
3605
- index: _TextIndex,
3696
+ index: str | float | _tkinter.Tcl_Obj | Widget,
3606
3697
  cnf: dict[str, Any] | None = None,
3607
3698
  *,
3608
3699
  align: Literal["baseline", "bottom", "center", "top"] = ...,
@@ -3615,7 +3706,7 @@ class Text(Widget, XView, YView):
3615
3706
  window_config = window_configure
3616
3707
  def window_create(
3617
3708
  self,
3618
- index: _TextIndex,
3709
+ index: str | float | _tkinter.Tcl_Obj | Widget,
3619
3710
  cnf: dict[str, Any] | None = {},
3620
3711
  *,
3621
3712
  align: Literal["baseline", "bottom", "center", "top"] = ...,