basedpyright 1.24.0 → 1.25.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 (189) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.LICENSE.txt +42 -0
  3. package/dist/pyright-langserver.js.map +1 -1
  4. package/dist/pyright.js +1 -1
  5. package/dist/pyright.js.map +1 -1
  6. package/dist/typeshed-fallback/stdlib/_asyncio.pyi +3 -25
  7. package/dist/typeshed-fallback/stdlib/_bisect.pyi +4 -44
  8. package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +2 -16
  10. package/dist/typeshed-fallback/stdlib/_dbm.pyi +1 -13
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +1 -8
  12. package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
  13. package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +164 -180
  14. package/dist/typeshed-fallback/stdlib/_gdbm.pyi +1 -39
  15. package/dist/typeshed-fallback/stdlib/_hashlib.pyi +7 -28
  16. package/dist/typeshed-fallback/stdlib/_imp.pyi +1 -3
  17. package/dist/typeshed-fallback/stdlib/_msi.pyi +92 -94
  18. package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +6 -48
  19. package/dist/typeshed-fallback/stdlib/_ssl.pyi +1 -8
  20. package/dist/typeshed-fallback/stdlib/_thread.pyi +1 -8
  21. package/dist/typeshed-fallback/stdlib/_warnings.pyi +2 -6
  22. package/dist/typeshed-fallback/stdlib/aifc.pyi +91 -91
  23. package/dist/typeshed-fallback/stdlib/array.pyi +3 -17
  24. package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
  25. package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +4 -23
  26. package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
  27. package/dist/typeshed-fallback/stdlib/audioop.pyi +43 -95
  28. package/dist/typeshed-fallback/stdlib/binascii.pyi +5 -15
  29. package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
  30. package/dist/typeshed-fallback/stdlib/builtins.pyi +8 -106
  31. package/dist/typeshed-fallback/stdlib/cgi.pyi +118 -118
  32. package/dist/typeshed-fallback/stdlib/cgitb.pyi +32 -32
  33. package/dist/typeshed-fallback/stdlib/chunk.pyi +20 -20
  34. package/dist/typeshed-fallback/stdlib/datetime.pyi +4 -12
  35. package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
  36. package/dist/typeshed-fallback/stdlib/distutils/_msvccompiler.pyi +13 -13
  37. package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
  38. package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
  39. package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +176 -176
  40. package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +229 -229
  41. package/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi +48 -48
  42. package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +27 -27
  43. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +22 -22
  44. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +46 -46
  45. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +53 -53
  46. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
  47. package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +34 -34
  48. package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +29 -29
  49. package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +52 -52
  50. package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +45 -45
  51. package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +25 -25
  52. package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +40 -40
  53. package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +18 -18
  54. package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
  55. package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +71 -71
  56. package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +20 -20
  57. package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +19 -19
  58. package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +17 -17
  59. package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +26 -26
  60. package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +19 -19
  61. package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +21 -21
  62. package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +45 -45
  63. package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +18 -18
  64. package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
  65. package/dist/typeshed-fallback/stdlib/distutils/core.pyi +58 -58
  66. package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
  67. package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +3 -3
  68. package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
  69. package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
  70. package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +317 -317
  71. package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
  72. package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
  73. package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
  74. package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
  75. package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
  76. package/dist/typeshed-fallback/stdlib/distutils/log.pyi +26 -26
  77. package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
  78. package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +10 -10
  79. package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
  80. package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
  81. package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
  82. package/dist/typeshed-fallback/stdlib/distutils/util.pyi +53 -53
  83. package/dist/typeshed-fallback/stdlib/distutils/version.pyi +36 -38
  84. package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
  85. package/dist/typeshed-fallback/stdlib/encodings/mac_centeuro.pyi +21 -21
  86. package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
  87. package/dist/typeshed-fallback/stdlib/hmac.pyi +2 -30
  88. package/dist/typeshed-fallback/stdlib/imghdr.pyi +17 -17
  89. package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
  90. package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +7 -36
  91. package/dist/typeshed-fallback/stdlib/lib2to3/btm_matcher.pyi +28 -28
  92. package/dist/typeshed-fallback/stdlib/lib2to3/fixer_base.pyi +42 -42
  93. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_apply.pyi +8 -8
  94. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -10
  95. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -8
  96. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -8
  97. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_dict.pyi +16 -16
  98. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi +14 -14
  99. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_exec.pyi +8 -8
  100. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -8
  101. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -13
  102. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_filter.pyi +9 -9
  103. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -8
  104. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_future.pyi +8 -8
  105. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -8
  106. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -8
  107. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -15
  108. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi +16 -16
  109. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi +21 -21
  110. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports2.pyi +8 -8
  111. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_input.pyi +11 -11
  112. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_intern.pyi +9 -9
  113. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -8
  114. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -9
  115. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -7
  116. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_long.pyi +7 -7
  117. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_map.pyi +9 -9
  118. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -17
  119. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -10
  120. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_ne.pyi +8 -8
  121. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_next.pyi +19 -19
  122. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -8
  123. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -8
  124. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_operator.pyi +12 -12
  125. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_paren.pyi +8 -8
  126. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_print.pyi +12 -12
  127. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_raise.pyi +8 -8
  128. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -8
  129. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -8
  130. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_reload.pyi +9 -9
  131. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi +17 -17
  132. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_repr.pyi +8 -8
  133. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -7
  134. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -8
  135. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -9
  136. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_throw.pyi +8 -8
  137. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_tuple_params.pyi +17 -17
  138. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_types.pyi +8 -8
  139. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -12
  140. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -15
  141. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -12
  142. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -20
  143. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -8
  144. package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_zip.pyi +9 -9
  145. package/dist/typeshed-fallback/stdlib/lib2to3/main.pyi +42 -42
  146. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/__init__.pyi +9 -9
  147. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi +27 -27
  148. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi +24 -24
  149. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/literals.pyi +7 -7
  150. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi +30 -30
  151. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi +50 -50
  152. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/token.pyi +69 -69
  153. package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi +96 -96
  154. package/dist/typeshed-fallback/stdlib/lib2to3/pygram.pyi +114 -114
  155. package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +117 -127
  156. package/dist/typeshed-fallback/stdlib/lib2to3/refactor.pyi +82 -82
  157. package/dist/typeshed-fallback/stdlib/mailcap.pyi +11 -11
  158. package/dist/typeshed-fallback/stdlib/marshal.pyi +4 -52
  159. package/dist/typeshed-fallback/stdlib/math.pyi +2 -6
  160. package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
  161. package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
  162. package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
  163. package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
  164. package/dist/typeshed-fallback/stdlib/nis.pyi +4 -31
  165. package/dist/typeshed-fallback/stdlib/nntplib.pyi +125 -125
  166. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +1 -8
  167. package/dist/typeshed-fallback/stdlib/parser.pyi +24 -55
  168. package/dist/typeshed-fallback/stdlib/pipes.pyi +16 -16
  169. package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
  170. package/dist/typeshed-fallback/stdlib/sndhdr.pyi +14 -14
  171. package/dist/typeshed-fallback/stdlib/spwd.pyi +13 -66
  172. package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +2 -6
  173. package/dist/typeshed-fallback/stdlib/ssl.pyi +0 -4
  174. package/dist/typeshed-fallback/stdlib/sunau.pyi +86 -86
  175. package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
  176. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +4 -40
  177. package/dist/typeshed-fallback/stdlib/telnetlib.pyi +123 -123
  178. package/dist/typeshed-fallback/stdlib/tkinter/tix.pyi +299 -299
  179. package/dist/typeshed-fallback/stdlib/types.pyi +2 -6
  180. package/dist/typeshed-fallback/stdlib/typing.pyi +2 -6
  181. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +544 -559
  182. package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +1 -6
  183. package/dist/typeshed-fallback/stdlib/uu.pyi +13 -13
  184. package/dist/typeshed-fallback/stdlib/xdrlib.pyi +57 -57
  185. package/dist/typeshed-fallback/stdlib/xxlimited.pyi +1 -3
  186. package/dist/typeshed-fallback/stdlib/zipimport.pyi +0 -29
  187. package/dist/typeshed-fallback/stdlib/zlib.pyi +1 -10
  188. package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +3 -9
  189. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
- from collections.abc import Generator
2
- from typing import Final, Literal
3
-
4
- from .fix_imports import FixImports
5
-
6
- MAPPING: Final[dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]]
7
-
8
- def build_pattern() -> Generator[str, None, None]: ...
9
-
10
- class FixUrllib(FixImports):
11
- def build_pattern(self): ...
12
- def transform_import(self, node, results) -> None: ...
13
- def transform_member(self, node, results): ...
14
- def transform_dot(self, node, results) -> None: ...
15
- def transform(self, node, results) -> None: ...
1
+ from collections.abc import Generator
2
+ from typing import Final, Literal
3
+
4
+ from .fix_imports import FixImports
5
+
6
+ MAPPING: Final[dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]]
7
+
8
+ def build_pattern() -> Generator[str, None, None]: ...
9
+
10
+ class FixUrllib(FixImports):
11
+ def build_pattern(self): ...
12
+ def transform_import(self, node, results) -> None: ...
13
+ def transform_member(self, node, results): ...
14
+ def transform_dot(self, node, results) -> None: ...
15
+ def transform(self, node, results) -> None: ...
@@ -1,12 +1,12 @@
1
- from typing import ClassVar, Literal
2
-
3
- from .. import fixer_base
4
- from ..pytree import Leaf
5
-
6
- class FixWsComma(fixer_base.BaseFix):
7
- BM_compatible: ClassVar[Literal[False]]
8
- PATTERN: ClassVar[str]
9
- COMMA: Leaf
10
- COLON: Leaf
11
- SEPS: tuple[Leaf, Leaf]
12
- def transform(self, node, results): ...
1
+ from typing import ClassVar, Literal
2
+
3
+ from .. import fixer_base
4
+ from ..pytree import Leaf
5
+
6
+ class FixWsComma(fixer_base.BaseFix):
7
+ BM_compatible: ClassVar[Literal[False]]
8
+ PATTERN: ClassVar[str]
9
+ COMMA: Leaf
10
+ COLON: Leaf
11
+ SEPS: tuple[Leaf, Leaf]
12
+ def transform(self, node, results): ...
@@ -1,20 +1,20 @@
1
- from _typeshed import Incomplete, StrPath
2
- from typing import ClassVar, Literal
3
-
4
- from .. import fixer_base
5
- from ..pytree import Node
6
-
7
- class FixXrange(fixer_base.BaseFix):
8
- BM_compatible: ClassVar[Literal[True]]
9
- PATTERN: ClassVar[str]
10
- transformed_xranges: set[Incomplete] | None
11
- def start_tree(self, tree: Node, filename: StrPath) -> None: ...
12
- def finish_tree(self, tree: Node, filename: StrPath) -> None: ...
13
- def transform(self, node, results): ...
14
- def transform_xrange(self, node, results) -> None: ...
15
- def transform_range(self, node, results): ...
16
- P1: ClassVar[str]
17
- p1: ClassVar[Incomplete]
18
- P2: ClassVar[str]
19
- p2: ClassVar[Incomplete]
20
- def in_special_context(self, node): ...
1
+ from _typeshed import Incomplete, StrPath
2
+ from typing import ClassVar, Literal
3
+
4
+ from .. import fixer_base
5
+ from ..pytree import Node
6
+
7
+ class FixXrange(fixer_base.BaseFix):
8
+ BM_compatible: ClassVar[Literal[True]]
9
+ PATTERN: ClassVar[str]
10
+ transformed_xranges: set[Incomplete] | None
11
+ def start_tree(self, tree: Node, filename: StrPath) -> None: ...
12
+ def finish_tree(self, tree: Node, filename: StrPath) -> None: ...
13
+ def transform(self, node, results): ...
14
+ def transform_xrange(self, node, results) -> None: ...
15
+ def transform_range(self, node, results): ...
16
+ P1: ClassVar[str]
17
+ p1: ClassVar[Incomplete]
18
+ P2: ClassVar[str]
19
+ p2: ClassVar[Incomplete]
20
+ def in_special_context(self, node): ...
@@ -1,8 +1,8 @@
1
- from typing import ClassVar, Literal
2
-
3
- from .. import fixer_base
4
-
5
- class FixXreadlines(fixer_base.BaseFix):
6
- BM_compatible: ClassVar[Literal[True]]
7
- PATTERN: ClassVar[str]
8
- def transform(self, node, results) -> None: ...
1
+ from typing import ClassVar, Literal
2
+
3
+ from .. import fixer_base
4
+
5
+ class FixXreadlines(fixer_base.BaseFix):
6
+ BM_compatible: ClassVar[Literal[True]]
7
+ PATTERN: ClassVar[str]
8
+ def transform(self, node, results) -> None: ...
@@ -1,9 +1,9 @@
1
- from typing import ClassVar, Literal
2
-
3
- from .. import fixer_base
4
-
5
- class FixZip(fixer_base.ConditionalFix):
6
- BM_compatible: ClassVar[Literal[True]]
7
- PATTERN: ClassVar[str]
8
- skip_on: ClassVar[Literal["future_builtins.zip"]]
9
- def transform(self, node, results): ...
1
+ from typing import ClassVar, Literal
2
+
3
+ from .. import fixer_base
4
+
5
+ class FixZip(fixer_base.ConditionalFix):
6
+ BM_compatible: ClassVar[Literal[True]]
7
+ PATTERN: ClassVar[str]
8
+ skip_on: ClassVar[Literal["future_builtins.zip"]]
9
+ def transform(self, node, results): ...
@@ -1,42 +1,42 @@
1
- from _typeshed import FileDescriptorOrPath
2
- from collections.abc import Container, Iterable, Iterator, Mapping, Sequence
3
- from logging import _ExcInfoType
4
- from typing import AnyStr, Literal
5
-
6
- from . import refactor as refactor
7
-
8
- def diff_texts(a: str, b: str, filename: str) -> Iterator[str]: ...
9
-
10
- class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
11
- nobackups: bool
12
- show_diffs: bool
13
- def __init__(
14
- self,
15
- fixers: Iterable[str],
16
- options: Mapping[str, object] | None,
17
- explicit: Container[str] | None,
18
- nobackups: bool,
19
- show_diffs: bool,
20
- input_base_dir: str = "",
21
- output_dir: str = "",
22
- append_suffix: str = "",
23
- ) -> None: ...
24
- # Same as super.log_error and Logger.error
25
- def log_error( # type: ignore[override]
26
- self,
27
- msg: str,
28
- *args: Iterable[str],
29
- exc_info: _ExcInfoType = None,
30
- stack_info: bool = False,
31
- stacklevel: int = 1,
32
- extra: Mapping[str, object] | None = None,
33
- ) -> None: ...
34
- # Same as super.write_file but without default values
35
- def write_file( # type: ignore[override]
36
- self, new_text: str, filename: FileDescriptorOrPath, old_text: str, encoding: str | None
37
- ) -> None: ...
38
- # filename has to be str
39
- def print_output(self, old: str, new: str, filename: str, equal: bool) -> None: ... # type: ignore[override]
40
-
41
- def warn(msg: object) -> None: ...
42
- def main(fixer_pkg: str, args: Sequence[AnyStr] | None = None) -> Literal[0, 1, 2]: ...
1
+ from _typeshed import FileDescriptorOrPath
2
+ from collections.abc import Container, Iterable, Iterator, Mapping, Sequence
3
+ from logging import _ExcInfoType
4
+ from typing import AnyStr, Literal
5
+
6
+ from . import refactor as refactor
7
+
8
+ def diff_texts(a: str, b: str, filename: str) -> Iterator[str]: ...
9
+
10
+ class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
11
+ nobackups: bool
12
+ show_diffs: bool
13
+ def __init__(
14
+ self,
15
+ fixers: Iterable[str],
16
+ options: Mapping[str, object] | None,
17
+ explicit: Container[str] | None,
18
+ nobackups: bool,
19
+ show_diffs: bool,
20
+ input_base_dir: str = "",
21
+ output_dir: str = "",
22
+ append_suffix: str = "",
23
+ ) -> None: ...
24
+ # Same as super.log_error and Logger.error
25
+ def log_error( # type: ignore[override]
26
+ self,
27
+ msg: str,
28
+ *args: Iterable[str],
29
+ exc_info: _ExcInfoType = None,
30
+ stack_info: bool = False,
31
+ stacklevel: int = 1,
32
+ extra: Mapping[str, object] | None = None,
33
+ ) -> None: ...
34
+ # Same as super.write_file but without default values
35
+ def write_file( # type: ignore[override]
36
+ self, new_text: str, filename: FileDescriptorOrPath, old_text: str, encoding: str | None
37
+ ) -> None: ...
38
+ # filename has to be str
39
+ def print_output(self, old: str, new: str, filename: str, equal: bool) -> None: ... # type: ignore[override]
40
+
41
+ def warn(msg: object) -> None: ...
42
+ def main(fixer_pkg: str, args: Sequence[AnyStr] | None = None) -> Literal[0, 1, 2]: ...
@@ -1,9 +1,9 @@
1
- from collections.abc import Callable
2
- from typing import Any
3
- from typing_extensions import TypeAlias
4
-
5
- from ..pytree import _RawNode
6
- from .grammar import Grammar
7
-
8
- # This is imported in several lib2to3/pgen2 submodules
9
- _Convert: TypeAlias = Callable[[Grammar, _RawNode], Any] # noqa: Y047
1
+ from collections.abc import Callable
2
+ from typing import Any
3
+ from typing_extensions import TypeAlias
4
+
5
+ from ..pytree import _RawNode
6
+ from .grammar import Grammar
7
+
8
+ # This is imported in several lib2to3/pgen2 submodules
9
+ _Convert: TypeAlias = Callable[[Grammar, _RawNode], Any] # noqa: Y047
@@ -1,27 +1,27 @@
1
- from _typeshed import StrPath
2
- from collections.abc import Iterable
3
- from logging import Logger
4
- from typing import IO
5
-
6
- from ..pytree import _NL
7
- from . import _Convert
8
- from .grammar import Grammar
9
-
10
- __all__ = ["Driver", "load_grammar"]
11
-
12
- class Driver:
13
- grammar: Grammar
14
- logger: Logger
15
- convert: _Convert
16
- def __init__(self, grammar: Grammar, convert: _Convert | None = None, logger: Logger | None = None) -> None: ...
17
- def parse_tokens(
18
- self, tokens: Iterable[tuple[int, str, tuple[int, int], tuple[int, int], str]], debug: bool = False
19
- ) -> _NL: ...
20
- def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> _NL: ...
21
- def parse_stream(self, stream: IO[str], debug: bool = False) -> _NL: ...
22
- def parse_file(self, filename: StrPath, encoding: str | None = None, debug: bool = False) -> _NL: ...
23
- def parse_string(self, text: str, debug: bool = False) -> _NL: ...
24
-
25
- def load_grammar(
26
- gt: str = "Grammar.txt", gp: str | None = None, save: bool = True, force: bool = False, logger: Logger | None = None
27
- ) -> Grammar: ...
1
+ from _typeshed import StrPath
2
+ from collections.abc import Iterable
3
+ from logging import Logger
4
+ from typing import IO
5
+
6
+ from ..pytree import _NL
7
+ from . import _Convert
8
+ from .grammar import Grammar
9
+
10
+ __all__ = ["Driver", "load_grammar"]
11
+
12
+ class Driver:
13
+ grammar: Grammar
14
+ logger: Logger
15
+ convert: _Convert
16
+ def __init__(self, grammar: Grammar, convert: _Convert | None = None, logger: Logger | None = None) -> None: ...
17
+ def parse_tokens(
18
+ self, tokens: Iterable[tuple[int, str, tuple[int, int], tuple[int, int], str]], debug: bool = False
19
+ ) -> _NL: ...
20
+ def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> _NL: ...
21
+ def parse_stream(self, stream: IO[str], debug: bool = False) -> _NL: ...
22
+ def parse_file(self, filename: StrPath, encoding: str | None = None, debug: bool = False) -> _NL: ...
23
+ def parse_string(self, text: str, debug: bool = False) -> _NL: ...
24
+
25
+ def load_grammar(
26
+ gt: str = "Grammar.txt", gp: str | None = None, save: bool = True, force: bool = False, logger: Logger | None = None
27
+ ) -> Grammar: ...
@@ -1,24 +1,24 @@
1
- from _typeshed import StrPath
2
- from typing_extensions import Self, TypeAlias
3
-
4
- _Label: TypeAlias = tuple[int, str | None]
5
- _DFA: TypeAlias = list[list[tuple[int, int]]]
6
- _DFAS: TypeAlias = tuple[_DFA, dict[int, int]]
7
-
8
- class Grammar:
9
- symbol2number: dict[str, int]
10
- number2symbol: dict[int, str]
11
- states: list[_DFA]
12
- dfas: dict[int, _DFAS]
13
- labels: list[_Label]
14
- keywords: dict[str, int]
15
- tokens: dict[int, int]
16
- symbol2label: dict[str, int]
17
- start: int
18
- def dump(self, filename: StrPath) -> None: ...
19
- def load(self, filename: StrPath) -> None: ...
20
- def copy(self) -> Self: ...
21
- def report(self) -> None: ...
22
-
23
- opmap_raw: str
24
- opmap: dict[str, str]
1
+ from _typeshed import StrPath
2
+ from typing_extensions import Self, TypeAlias
3
+
4
+ _Label: TypeAlias = tuple[int, str | None]
5
+ _DFA: TypeAlias = list[list[tuple[int, int]]]
6
+ _DFAS: TypeAlias = tuple[_DFA, dict[int, int]]
7
+
8
+ class Grammar:
9
+ symbol2number: dict[str, int]
10
+ number2symbol: dict[int, str]
11
+ states: list[_DFA]
12
+ dfas: dict[int, _DFAS]
13
+ labels: list[_Label]
14
+ keywords: dict[str, int]
15
+ tokens: dict[int, int]
16
+ symbol2label: dict[str, int]
17
+ start: int
18
+ def dump(self, filename: StrPath) -> None: ...
19
+ def load(self, filename: StrPath) -> None: ...
20
+ def copy(self) -> Self: ...
21
+ def report(self) -> None: ...
22
+
23
+ opmap_raw: str
24
+ opmap: dict[str, str]
@@ -1,7 +1,7 @@
1
- from re import Match
2
-
3
- simple_escapes: dict[str, str]
4
-
5
- def escape(m: Match[str]) -> str: ...
6
- def evalString(s: str) -> str: ...
7
- def test() -> None: ...
1
+ from re import Match
2
+
3
+ simple_escapes: dict[str, str]
4
+
5
+ def escape(m: Match[str]) -> str: ...
6
+ def evalString(s: str) -> str: ...
7
+ def test() -> None: ...
@@ -1,30 +1,30 @@
1
- from _typeshed import Incomplete
2
- from collections.abc import Sequence
3
- from typing_extensions import TypeAlias
4
-
5
- from ..pytree import _NL, _RawNode
6
- from . import _Convert
7
- from .grammar import _DFAS, Grammar
8
-
9
- _Context: TypeAlias = Sequence[Incomplete]
10
-
11
- class ParseError(Exception):
12
- msg: str
13
- type: int
14
- value: str | None
15
- context: _Context
16
- def __init__(self, msg: str, type: int, value: str | None, context: _Context) -> None: ...
17
-
18
- class Parser:
19
- grammar: Grammar
20
- convert: _Convert
21
- stack: list[tuple[_DFAS, int, _RawNode]]
22
- rootnode: _NL | None
23
- used_names: set[str]
24
- def __init__(self, grammar: Grammar, convert: _Convert | None = None) -> None: ...
25
- def setup(self, start: int | None = None) -> None: ...
26
- def addtoken(self, type: int, value: str | None, context: _Context) -> bool: ...
27
- def classify(self, type: int, value: str | None, context: _Context) -> int: ...
28
- def shift(self, type: int, value: str | None, newstate: int, context: _Context) -> None: ...
29
- def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ...
30
- def pop(self) -> None: ...
1
+ from _typeshed import Incomplete
2
+ from collections.abc import Sequence
3
+ from typing_extensions import TypeAlias
4
+
5
+ from ..pytree import _NL, _RawNode
6
+ from . import _Convert
7
+ from .grammar import _DFAS, Grammar
8
+
9
+ _Context: TypeAlias = Sequence[Incomplete]
10
+
11
+ class ParseError(Exception):
12
+ msg: str
13
+ type: int
14
+ value: str | None
15
+ context: _Context
16
+ def __init__(self, msg: str, type: int, value: str | None, context: _Context) -> None: ...
17
+
18
+ class Parser:
19
+ grammar: Grammar
20
+ convert: _Convert
21
+ stack: list[tuple[_DFAS, int, _RawNode]]
22
+ rootnode: _NL | None
23
+ used_names: set[str]
24
+ def __init__(self, grammar: Grammar, convert: _Convert | None = None) -> None: ...
25
+ def setup(self, start: int | None = None) -> None: ...
26
+ def addtoken(self, type: int, value: str | None, context: _Context) -> bool: ...
27
+ def classify(self, type: int, value: str | None, context: _Context) -> int: ...
28
+ def shift(self, type: int, value: str | None, newstate: int, context: _Context) -> None: ...
29
+ def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ...
30
+ def pop(self) -> None: ...
@@ -1,50 +1,50 @@
1
- from _typeshed import Incomplete, StrPath
2
- from collections.abc import Iterable, Iterator
3
- from typing import IO, NoReturn, overload
4
-
5
- from . import grammar
6
- from .tokenize import _TokenInfo
7
-
8
- class PgenGrammar(grammar.Grammar): ...
9
-
10
- class ParserGenerator:
11
- filename: StrPath
12
- stream: IO[str]
13
- generator: Iterator[_TokenInfo]
14
- first: dict[str, dict[str, int]]
15
- def __init__(self, filename: StrPath, stream: IO[str] | None = None) -> None: ...
16
- def make_grammar(self) -> PgenGrammar: ...
17
- def make_first(self, c: PgenGrammar, name: str) -> dict[int, int]: ...
18
- def make_label(self, c: PgenGrammar, label: str) -> int: ...
19
- def addfirstsets(self) -> None: ...
20
- def calcfirst(self, name: str) -> None: ...
21
- def parse(self) -> tuple[dict[str, list[DFAState]], str]: ...
22
- def make_dfa(self, start: NFAState, finish: NFAState) -> list[DFAState]: ...
23
- def dump_nfa(self, name: str, start: NFAState, finish: NFAState) -> list[DFAState]: ...
24
- def dump_dfa(self, name: str, dfa: Iterable[DFAState]) -> None: ...
25
- def simplify_dfa(self, dfa: list[DFAState]) -> None: ...
26
- def parse_rhs(self) -> tuple[NFAState, NFAState]: ...
27
- def parse_alt(self) -> tuple[NFAState, NFAState]: ...
28
- def parse_item(self) -> tuple[NFAState, NFAState]: ...
29
- def parse_atom(self) -> tuple[NFAState, NFAState]: ...
30
- def expect(self, type: int, value: str | None = None) -> str: ...
31
- def gettoken(self) -> None: ...
32
- @overload
33
- def raise_error(self, msg: object) -> NoReturn: ...
34
- @overload
35
- def raise_error(self, msg: str, *args: object) -> NoReturn: ...
36
-
37
- class NFAState:
38
- arcs: list[tuple[str | None, NFAState]]
39
- def addarc(self, next: NFAState, label: str | None = None) -> None: ...
40
-
41
- class DFAState:
42
- nfaset: dict[NFAState, Incomplete]
43
- isfinal: bool
44
- arcs: dict[str, DFAState]
45
- def __init__(self, nfaset: dict[NFAState, Incomplete], final: NFAState) -> None: ...
46
- def addarc(self, next: DFAState, label: str) -> None: ...
47
- def unifystate(self, old: DFAState, new: DFAState) -> None: ...
48
- def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override]
49
-
50
- def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ...
1
+ from _typeshed import Incomplete, StrPath
2
+ from collections.abc import Iterable, Iterator
3
+ from typing import IO, NoReturn, overload
4
+
5
+ from . import grammar
6
+ from .tokenize import _TokenInfo
7
+
8
+ class PgenGrammar(grammar.Grammar): ...
9
+
10
+ class ParserGenerator:
11
+ filename: StrPath
12
+ stream: IO[str]
13
+ generator: Iterator[_TokenInfo]
14
+ first: dict[str, dict[str, int]]
15
+ def __init__(self, filename: StrPath, stream: IO[str] | None = None) -> None: ...
16
+ def make_grammar(self) -> PgenGrammar: ...
17
+ def make_first(self, c: PgenGrammar, name: str) -> dict[int, int]: ...
18
+ def make_label(self, c: PgenGrammar, label: str) -> int: ...
19
+ def addfirstsets(self) -> None: ...
20
+ def calcfirst(self, name: str) -> None: ...
21
+ def parse(self) -> tuple[dict[str, list[DFAState]], str]: ...
22
+ def make_dfa(self, start: NFAState, finish: NFAState) -> list[DFAState]: ...
23
+ def dump_nfa(self, name: str, start: NFAState, finish: NFAState) -> list[DFAState]: ...
24
+ def dump_dfa(self, name: str, dfa: Iterable[DFAState]) -> None: ...
25
+ def simplify_dfa(self, dfa: list[DFAState]) -> None: ...
26
+ def parse_rhs(self) -> tuple[NFAState, NFAState]: ...
27
+ def parse_alt(self) -> tuple[NFAState, NFAState]: ...
28
+ def parse_item(self) -> tuple[NFAState, NFAState]: ...
29
+ def parse_atom(self) -> tuple[NFAState, NFAState]: ...
30
+ def expect(self, type: int, value: str | None = None) -> str: ...
31
+ def gettoken(self) -> None: ...
32
+ @overload
33
+ def raise_error(self, msg: object) -> NoReturn: ...
34
+ @overload
35
+ def raise_error(self, msg: str, *args: object) -> NoReturn: ...
36
+
37
+ class NFAState:
38
+ arcs: list[tuple[str | None, NFAState]]
39
+ def addarc(self, next: NFAState, label: str | None = None) -> None: ...
40
+
41
+ class DFAState:
42
+ nfaset: dict[NFAState, Incomplete]
43
+ isfinal: bool
44
+ arcs: dict[str, DFAState]
45
+ def __init__(self, nfaset: dict[NFAState, Incomplete], final: NFAState) -> None: ...
46
+ def addarc(self, next: DFAState, label: str) -> None: ...
47
+ def unifystate(self, old: DFAState, new: DFAState) -> None: ...
48
+ def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override]
49
+
50
+ def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ...
@@ -1,69 +1,69 @@
1
- from typing import Final
2
-
3
- ENDMARKER: Final[int]
4
- NAME: Final[int]
5
- NUMBER: Final[int]
6
- STRING: Final[int]
7
- NEWLINE: Final[int]
8
- INDENT: Final[int]
9
- DEDENT: Final[int]
10
- LPAR: Final[int]
11
- RPAR: Final[int]
12
- LSQB: Final[int]
13
- RSQB: Final[int]
14
- COLON: Final[int]
15
- COMMA: Final[int]
16
- SEMI: Final[int]
17
- PLUS: Final[int]
18
- MINUS: Final[int]
19
- STAR: Final[int]
20
- SLASH: Final[int]
21
- VBAR: Final[int]
22
- AMPER: Final[int]
23
- LESS: Final[int]
24
- GREATER: Final[int]
25
- EQUAL: Final[int]
26
- DOT: Final[int]
27
- PERCENT: Final[int]
28
- BACKQUOTE: Final[int]
29
- LBRACE: Final[int]
30
- RBRACE: Final[int]
31
- EQEQUAL: Final[int]
32
- NOTEQUAL: Final[int]
33
- LESSEQUAL: Final[int]
34
- GREATEREQUAL: Final[int]
35
- TILDE: Final[int]
36
- CIRCUMFLEX: Final[int]
37
- LEFTSHIFT: Final[int]
38
- RIGHTSHIFT: Final[int]
39
- DOUBLESTAR: Final[int]
40
- PLUSEQUAL: Final[int]
41
- MINEQUAL: Final[int]
42
- STAREQUAL: Final[int]
43
- SLASHEQUAL: Final[int]
44
- PERCENTEQUAL: Final[int]
45
- AMPEREQUAL: Final[int]
46
- VBAREQUAL: Final[int]
47
- CIRCUMFLEXEQUAL: Final[int]
48
- LEFTSHIFTEQUAL: Final[int]
49
- RIGHTSHIFTEQUAL: Final[int]
50
- DOUBLESTAREQUAL: Final[int]
51
- DOUBLESLASH: Final[int]
52
- DOUBLESLASHEQUAL: Final[int]
53
- OP: Final[int]
54
- COMMENT: Final[int]
55
- NL: Final[int]
56
- RARROW: Final[int]
57
- AT: Final[int]
58
- ATEQUAL: Final[int]
59
- AWAIT: Final[int]
60
- ASYNC: Final[int]
61
- ERRORTOKEN: Final[int]
62
- COLONEQUAL: Final[int]
63
- N_TOKENS: Final[int]
64
- NT_OFFSET: Final[int]
65
- tok_name: dict[int, str]
66
-
67
- def ISTERMINAL(x: int) -> bool: ...
68
- def ISNONTERMINAL(x: int) -> bool: ...
69
- def ISEOF(x: int) -> bool: ...
1
+ from typing import Final
2
+
3
+ ENDMARKER: Final[int]
4
+ NAME: Final[int]
5
+ NUMBER: Final[int]
6
+ STRING: Final[int]
7
+ NEWLINE: Final[int]
8
+ INDENT: Final[int]
9
+ DEDENT: Final[int]
10
+ LPAR: Final[int]
11
+ RPAR: Final[int]
12
+ LSQB: Final[int]
13
+ RSQB: Final[int]
14
+ COLON: Final[int]
15
+ COMMA: Final[int]
16
+ SEMI: Final[int]
17
+ PLUS: Final[int]
18
+ MINUS: Final[int]
19
+ STAR: Final[int]
20
+ SLASH: Final[int]
21
+ VBAR: Final[int]
22
+ AMPER: Final[int]
23
+ LESS: Final[int]
24
+ GREATER: Final[int]
25
+ EQUAL: Final[int]
26
+ DOT: Final[int]
27
+ PERCENT: Final[int]
28
+ BACKQUOTE: Final[int]
29
+ LBRACE: Final[int]
30
+ RBRACE: Final[int]
31
+ EQEQUAL: Final[int]
32
+ NOTEQUAL: Final[int]
33
+ LESSEQUAL: Final[int]
34
+ GREATEREQUAL: Final[int]
35
+ TILDE: Final[int]
36
+ CIRCUMFLEX: Final[int]
37
+ LEFTSHIFT: Final[int]
38
+ RIGHTSHIFT: Final[int]
39
+ DOUBLESTAR: Final[int]
40
+ PLUSEQUAL: Final[int]
41
+ MINEQUAL: Final[int]
42
+ STAREQUAL: Final[int]
43
+ SLASHEQUAL: Final[int]
44
+ PERCENTEQUAL: Final[int]
45
+ AMPEREQUAL: Final[int]
46
+ VBAREQUAL: Final[int]
47
+ CIRCUMFLEXEQUAL: Final[int]
48
+ LEFTSHIFTEQUAL: Final[int]
49
+ RIGHTSHIFTEQUAL: Final[int]
50
+ DOUBLESTAREQUAL: Final[int]
51
+ DOUBLESLASH: Final[int]
52
+ DOUBLESLASHEQUAL: Final[int]
53
+ OP: Final[int]
54
+ COMMENT: Final[int]
55
+ NL: Final[int]
56
+ RARROW: Final[int]
57
+ AT: Final[int]
58
+ ATEQUAL: Final[int]
59
+ AWAIT: Final[int]
60
+ ASYNC: Final[int]
61
+ ERRORTOKEN: Final[int]
62
+ COLONEQUAL: Final[int]
63
+ N_TOKENS: Final[int]
64
+ NT_OFFSET: Final[int]
65
+ tok_name: dict[int, str]
66
+
67
+ def ISTERMINAL(x: int) -> bool: ...
68
+ def ISNONTERMINAL(x: int) -> bool: ...
69
+ def ISEOF(x: int) -> bool: ...