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,96 +1,96 @@
1
- from collections.abc import Callable, Iterable, Iterator
2
- from typing_extensions import TypeAlias
3
-
4
- from .token import *
5
-
6
- __all__ = [
7
- "AMPER",
8
- "AMPEREQUAL",
9
- "ASYNC",
10
- "AT",
11
- "ATEQUAL",
12
- "AWAIT",
13
- "BACKQUOTE",
14
- "CIRCUMFLEX",
15
- "CIRCUMFLEXEQUAL",
16
- "COLON",
17
- "COMMA",
18
- "COMMENT",
19
- "DEDENT",
20
- "DOT",
21
- "DOUBLESLASH",
22
- "DOUBLESLASHEQUAL",
23
- "DOUBLESTAR",
24
- "DOUBLESTAREQUAL",
25
- "ENDMARKER",
26
- "EQEQUAL",
27
- "EQUAL",
28
- "ERRORTOKEN",
29
- "GREATER",
30
- "GREATEREQUAL",
31
- "INDENT",
32
- "ISEOF",
33
- "ISNONTERMINAL",
34
- "ISTERMINAL",
35
- "LBRACE",
36
- "LEFTSHIFT",
37
- "LEFTSHIFTEQUAL",
38
- "LESS",
39
- "LESSEQUAL",
40
- "LPAR",
41
- "LSQB",
42
- "MINEQUAL",
43
- "MINUS",
44
- "NAME",
45
- "NEWLINE",
46
- "NL",
47
- "NOTEQUAL",
48
- "NT_OFFSET",
49
- "NUMBER",
50
- "N_TOKENS",
51
- "OP",
52
- "PERCENT",
53
- "PERCENTEQUAL",
54
- "PLUS",
55
- "PLUSEQUAL",
56
- "RARROW",
57
- "RBRACE",
58
- "RIGHTSHIFT",
59
- "RIGHTSHIFTEQUAL",
60
- "RPAR",
61
- "RSQB",
62
- "SEMI",
63
- "SLASH",
64
- "SLASHEQUAL",
65
- "STAR",
66
- "STAREQUAL",
67
- "STRING",
68
- "TILDE",
69
- "VBAR",
70
- "VBAREQUAL",
71
- "tok_name",
72
- "tokenize",
73
- "generate_tokens",
74
- "untokenize",
75
- "COLONEQUAL",
76
- ]
77
-
78
- _Coord: TypeAlias = tuple[int, int]
79
- _TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object]
80
- _TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str]
81
-
82
- class TokenError(Exception): ...
83
- class StopTokenizing(Exception): ...
84
-
85
- def tokenize(readline: Callable[[], str], tokeneater: _TokenEater = ...) -> None: ...
86
-
87
- class Untokenizer:
88
- tokens: list[str]
89
- prev_row: int
90
- prev_col: int
91
- def add_whitespace(self, start: _Coord) -> None: ...
92
- def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ...
93
- def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ...
94
-
95
- def untokenize(iterable: Iterable[_TokenInfo]) -> str: ...
96
- def generate_tokens(readline: Callable[[], str]) -> Iterator[_TokenInfo]: ...
1
+ from collections.abc import Callable, Iterable, Iterator
2
+ from typing_extensions import TypeAlias
3
+
4
+ from .token import *
5
+
6
+ __all__ = [
7
+ "AMPER",
8
+ "AMPEREQUAL",
9
+ "ASYNC",
10
+ "AT",
11
+ "ATEQUAL",
12
+ "AWAIT",
13
+ "BACKQUOTE",
14
+ "CIRCUMFLEX",
15
+ "CIRCUMFLEXEQUAL",
16
+ "COLON",
17
+ "COMMA",
18
+ "COMMENT",
19
+ "DEDENT",
20
+ "DOT",
21
+ "DOUBLESLASH",
22
+ "DOUBLESLASHEQUAL",
23
+ "DOUBLESTAR",
24
+ "DOUBLESTAREQUAL",
25
+ "ENDMARKER",
26
+ "EQEQUAL",
27
+ "EQUAL",
28
+ "ERRORTOKEN",
29
+ "GREATER",
30
+ "GREATEREQUAL",
31
+ "INDENT",
32
+ "ISEOF",
33
+ "ISNONTERMINAL",
34
+ "ISTERMINAL",
35
+ "LBRACE",
36
+ "LEFTSHIFT",
37
+ "LEFTSHIFTEQUAL",
38
+ "LESS",
39
+ "LESSEQUAL",
40
+ "LPAR",
41
+ "LSQB",
42
+ "MINEQUAL",
43
+ "MINUS",
44
+ "NAME",
45
+ "NEWLINE",
46
+ "NL",
47
+ "NOTEQUAL",
48
+ "NT_OFFSET",
49
+ "NUMBER",
50
+ "N_TOKENS",
51
+ "OP",
52
+ "PERCENT",
53
+ "PERCENTEQUAL",
54
+ "PLUS",
55
+ "PLUSEQUAL",
56
+ "RARROW",
57
+ "RBRACE",
58
+ "RIGHTSHIFT",
59
+ "RIGHTSHIFTEQUAL",
60
+ "RPAR",
61
+ "RSQB",
62
+ "SEMI",
63
+ "SLASH",
64
+ "SLASHEQUAL",
65
+ "STAR",
66
+ "STAREQUAL",
67
+ "STRING",
68
+ "TILDE",
69
+ "VBAR",
70
+ "VBAREQUAL",
71
+ "tok_name",
72
+ "tokenize",
73
+ "generate_tokens",
74
+ "untokenize",
75
+ "COLONEQUAL",
76
+ ]
77
+
78
+ _Coord: TypeAlias = tuple[int, int]
79
+ _TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object]
80
+ _TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str]
81
+
82
+ class TokenError(Exception): ...
83
+ class StopTokenizing(Exception): ...
84
+
85
+ def tokenize(readline: Callable[[], str], tokeneater: _TokenEater = ...) -> None: ...
86
+
87
+ class Untokenizer:
88
+ tokens: list[str]
89
+ prev_row: int
90
+ prev_col: int
91
+ def add_whitespace(self, start: _Coord) -> None: ...
92
+ def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ...
93
+ def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ...
94
+
95
+ def untokenize(iterable: Iterable[_TokenInfo]) -> str: ...
96
+ def generate_tokens(readline: Callable[[], str]) -> Iterator[_TokenInfo]: ...
@@ -1,114 +1,114 @@
1
- from .pgen2.grammar import Grammar
2
-
3
- class Symbols:
4
- def __init__(self, grammar: Grammar) -> None: ...
5
-
6
- class python_symbols(Symbols):
7
- and_expr: int
8
- and_test: int
9
- annassign: int
10
- arglist: int
11
- argument: int
12
- arith_expr: int
13
- assert_stmt: int
14
- async_funcdef: int
15
- async_stmt: int
16
- atom: int
17
- augassign: int
18
- break_stmt: int
19
- classdef: int
20
- comp_for: int
21
- comp_if: int
22
- comp_iter: int
23
- comp_op: int
24
- comparison: int
25
- compound_stmt: int
26
- continue_stmt: int
27
- decorated: int
28
- decorator: int
29
- decorators: int
30
- del_stmt: int
31
- dictsetmaker: int
32
- dotted_as_name: int
33
- dotted_as_names: int
34
- dotted_name: int
35
- encoding_decl: int
36
- eval_input: int
37
- except_clause: int
38
- exec_stmt: int
39
- expr: int
40
- expr_stmt: int
41
- exprlist: int
42
- factor: int
43
- file_input: int
44
- flow_stmt: int
45
- for_stmt: int
46
- funcdef: int
47
- global_stmt: int
48
- if_stmt: int
49
- import_as_name: int
50
- import_as_names: int
51
- import_from: int
52
- import_name: int
53
- import_stmt: int
54
- lambdef: int
55
- listmaker: int
56
- not_test: int
57
- old_lambdef: int
58
- old_test: int
59
- or_test: int
60
- parameters: int
61
- pass_stmt: int
62
- power: int
63
- print_stmt: int
64
- raise_stmt: int
65
- return_stmt: int
66
- shift_expr: int
67
- simple_stmt: int
68
- single_input: int
69
- sliceop: int
70
- small_stmt: int
71
- star_expr: int
72
- stmt: int
73
- subscript: int
74
- subscriptlist: int
75
- suite: int
76
- term: int
77
- test: int
78
- testlist: int
79
- testlist1: int
80
- testlist_gexp: int
81
- testlist_safe: int
82
- testlist_star_expr: int
83
- tfpdef: int
84
- tfplist: int
85
- tname: int
86
- trailer: int
87
- try_stmt: int
88
- typedargslist: int
89
- varargslist: int
90
- vfpdef: int
91
- vfplist: int
92
- vname: int
93
- while_stmt: int
94
- with_item: int
95
- with_stmt: int
96
- with_var: int
97
- xor_expr: int
98
- yield_arg: int
99
- yield_expr: int
100
- yield_stmt: int
101
-
102
- class pattern_symbols(Symbols):
103
- Alternative: int
104
- Alternatives: int
105
- Details: int
106
- Matcher: int
107
- NegatedUnit: int
108
- Repeater: int
109
- Unit: int
110
-
111
- python_grammar: Grammar
112
- python_grammar_no_print_statement: Grammar
113
- python_grammar_no_print_and_exec_statement: Grammar
114
- pattern_grammar: Grammar
1
+ from .pgen2.grammar import Grammar
2
+
3
+ class Symbols:
4
+ def __init__(self, grammar: Grammar) -> None: ...
5
+
6
+ class python_symbols(Symbols):
7
+ and_expr: int
8
+ and_test: int
9
+ annassign: int
10
+ arglist: int
11
+ argument: int
12
+ arith_expr: int
13
+ assert_stmt: int
14
+ async_funcdef: int
15
+ async_stmt: int
16
+ atom: int
17
+ augassign: int
18
+ break_stmt: int
19
+ classdef: int
20
+ comp_for: int
21
+ comp_if: int
22
+ comp_iter: int
23
+ comp_op: int
24
+ comparison: int
25
+ compound_stmt: int
26
+ continue_stmt: int
27
+ decorated: int
28
+ decorator: int
29
+ decorators: int
30
+ del_stmt: int
31
+ dictsetmaker: int
32
+ dotted_as_name: int
33
+ dotted_as_names: int
34
+ dotted_name: int
35
+ encoding_decl: int
36
+ eval_input: int
37
+ except_clause: int
38
+ exec_stmt: int
39
+ expr: int
40
+ expr_stmt: int
41
+ exprlist: int
42
+ factor: int
43
+ file_input: int
44
+ flow_stmt: int
45
+ for_stmt: int
46
+ funcdef: int
47
+ global_stmt: int
48
+ if_stmt: int
49
+ import_as_name: int
50
+ import_as_names: int
51
+ import_from: int
52
+ import_name: int
53
+ import_stmt: int
54
+ lambdef: int
55
+ listmaker: int
56
+ not_test: int
57
+ old_lambdef: int
58
+ old_test: int
59
+ or_test: int
60
+ parameters: int
61
+ pass_stmt: int
62
+ power: int
63
+ print_stmt: int
64
+ raise_stmt: int
65
+ return_stmt: int
66
+ shift_expr: int
67
+ simple_stmt: int
68
+ single_input: int
69
+ sliceop: int
70
+ small_stmt: int
71
+ star_expr: int
72
+ stmt: int
73
+ subscript: int
74
+ subscriptlist: int
75
+ suite: int
76
+ term: int
77
+ test: int
78
+ testlist: int
79
+ testlist1: int
80
+ testlist_gexp: int
81
+ testlist_safe: int
82
+ testlist_star_expr: int
83
+ tfpdef: int
84
+ tfplist: int
85
+ tname: int
86
+ trailer: int
87
+ try_stmt: int
88
+ typedargslist: int
89
+ varargslist: int
90
+ vfpdef: int
91
+ vfplist: int
92
+ vname: int
93
+ while_stmt: int
94
+ with_item: int
95
+ with_stmt: int
96
+ with_var: int
97
+ xor_expr: int
98
+ yield_arg: int
99
+ yield_expr: int
100
+ yield_stmt: int
101
+
102
+ class pattern_symbols(Symbols):
103
+ Alternative: int
104
+ Alternatives: int
105
+ Details: int
106
+ Matcher: int
107
+ NegatedUnit: int
108
+ Repeater: int
109
+ Unit: int
110
+
111
+ python_grammar: Grammar
112
+ python_grammar_no_print_statement: Grammar
113
+ python_grammar_no_print_and_exec_statement: Grammar
114
+ pattern_grammar: Grammar
@@ -1,127 +1,117 @@
1
- from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused
2
- from abc import abstractmethod
3
- from collections.abc import Iterable, Iterator, MutableSequence
4
- from typing import Final
5
- from typing_extensions import Self, TypeAlias
6
-
7
- from .fixer_base import BaseFix
8
- from .pgen2.grammar import Grammar
9
-
10
- _NL: TypeAlias = Node | Leaf
11
- _Context: TypeAlias = tuple[str, int, int]
12
- _Results: TypeAlias = dict[str, _NL]
13
- _RawNode: TypeAlias = tuple[int, str, _Context, list[_NL] | None]
14
-
15
- HUGE: Final = 0x7FFFFFFF
16
-
17
- def type_repr(type_num: int) -> str | int: ...
18
-
19
- class Base:
20
- type: int
21
- parent: Node | None
22
- prefix: str
23
- children: list[_NL]
24
- was_changed: bool
25
- was_checked: bool
26
- def __eq__(self, other: object) -> bool: ...
27
- @abstractmethod
28
- def _eq(self, other: Base) -> bool: ...
29
- @abstractmethod
30
- def clone(self) -> Self: ...
31
- @abstractmethod
32
- def post_order(self) -> Iterator[Self]: ...
33
- @abstractmethod
34
- def pre_order(self) -> Iterator[Self]: ...
35
- def replace(self, new: _NL | list[_NL]) -> None: ...
36
- def get_lineno(self) -> int: ...
37
- def changed(self) -> None: ...
38
- def remove(self) -> int | None: ...
39
- @property
40
- def next_sibling(self) -> _NL | None:
41
- """
42
- The node immediately following the invocant in their parent's children
43
- list. If the invocant does not have a next sibling, it is None
44
- """
45
- ...
46
- @property
47
- def prev_sibling(self) -> _NL | None:
48
- """
49
- The node immediately preceding the invocant in their parent's children
50
- list. If the invocant does not have a previous sibling, it is None.
51
- """
52
- ...
53
- def leaves(self) -> Iterator[Leaf]: ...
54
- def depth(self) -> int: ...
55
- def get_suffix(self) -> str: ...
56
-
57
- class Node(Base):
58
- fixers_applied: MutableSequence[BaseFix] | None
59
- # Is Unbound until set in refactor.RefactoringTool
60
- future_features: frozenset[Incomplete]
61
- # Is Unbound until set in pgen2.parse.Parser.pop
62
- used_names: set[str]
63
- def __init__(
64
- self,
65
- type: int,
66
- children: Iterable[_NL],
67
- context: Unused = None,
68
- prefix: str | None = None,
69
- fixers_applied: MutableSequence[BaseFix] | None = None,
70
- ) -> None: ...
71
- def _eq(self, other: Base) -> bool: ...
72
- def clone(self) -> Node: ...
73
- def post_order(self) -> Iterator[Self]: ...
74
- def pre_order(self) -> Iterator[Self]: ...
75
- def set_child(self, i: int, child: _NL) -> None: ...
76
- def insert_child(self, i: int, child: _NL) -> None: ...
77
- def append_child(self, child: _NL) -> None: ...
78
- def __unicode__(self) -> str: ...
79
-
80
- class Leaf(Base):
81
- lineno: int
82
- column: int
83
- value: str
84
- fixers_applied: MutableSequence[BaseFix]
85
- def __init__(
86
- self,
87
- type: int,
88
- value: str,
89
- context: _Context | None = None,
90
- prefix: str | None = None,
91
- fixers_applied: MutableSequence[BaseFix] = [],
92
- ) -> None: ...
93
- def _eq(self, other: Base) -> bool: ...
94
- def clone(self) -> Leaf: ...
95
- def post_order(self) -> Iterator[Self]: ...
96
- def pre_order(self) -> Iterator[Self]: ...
97
- def __unicode__(self) -> str: ...
98
-
99
- def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ...
100
-
101
- class BasePattern:
102
- type: int
103
- content: str | None
104
- name: str | None
105
- def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns
106
- def match(self, node: _NL, results: _Results | None = None) -> bool: ...
107
- def match_seq(self, nodes: SupportsLenAndGetItem[_NL], results: _Results | None = None) -> bool: ...
108
- def generate_matches(self, nodes: SupportsGetItem[int, _NL]) -> Iterator[tuple[int, _Results]]: ...
109
-
110
- class LeafPattern(BasePattern):
111
- def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ...
112
-
113
- class NodePattern(BasePattern):
114
- wildcards: bool
115
- def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ...
116
-
117
- class WildcardPattern(BasePattern):
118
- min: int
119
- max: int
120
- def __init__(self, content: str | None = None, min: int = 0, max: int = 0x7FFFFFFF, name: str | None = None) -> None: ...
121
-
122
- class NegatedPattern(BasePattern):
123
- def __init__(self, content: str | None = None) -> None: ...
124
-
125
- def generate_matches(
126
- patterns: SupportsGetItem[int | slice, BasePattern] | None, nodes: SupportsGetItem[int | slice, _NL]
127
- ) -> Iterator[tuple[int, _Results]]: ...
1
+ from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused
2
+ from abc import abstractmethod
3
+ from collections.abc import Iterable, Iterator, MutableSequence
4
+ from typing import Final
5
+ from typing_extensions import Self, TypeAlias
6
+
7
+ from .fixer_base import BaseFix
8
+ from .pgen2.grammar import Grammar
9
+
10
+ _NL: TypeAlias = Node | Leaf
11
+ _Context: TypeAlias = tuple[str, int, int]
12
+ _Results: TypeAlias = dict[str, _NL]
13
+ _RawNode: TypeAlias = tuple[int, str, _Context, list[_NL] | None]
14
+
15
+ HUGE: Final = 0x7FFFFFFF
16
+
17
+ def type_repr(type_num: int) -> str | int: ...
18
+
19
+ class Base:
20
+ type: int
21
+ parent: Node | None
22
+ prefix: str
23
+ children: list[_NL]
24
+ was_changed: bool
25
+ was_checked: bool
26
+ def __eq__(self, other: object) -> bool: ...
27
+ @abstractmethod
28
+ def _eq(self, other: Base) -> bool: ...
29
+ @abstractmethod
30
+ def clone(self) -> Self: ...
31
+ @abstractmethod
32
+ def post_order(self) -> Iterator[Self]: ...
33
+ @abstractmethod
34
+ def pre_order(self) -> Iterator[Self]: ...
35
+ def replace(self, new: _NL | list[_NL]) -> None: ...
36
+ def get_lineno(self) -> int: ...
37
+ def changed(self) -> None: ...
38
+ def remove(self) -> int | None: ...
39
+ @property
40
+ def next_sibling(self) -> _NL | None: ...
41
+ @property
42
+ def prev_sibling(self) -> _NL | None: ...
43
+ def leaves(self) -> Iterator[Leaf]: ...
44
+ def depth(self) -> int: ...
45
+ def get_suffix(self) -> str: ...
46
+
47
+ class Node(Base):
48
+ fixers_applied: MutableSequence[BaseFix] | None
49
+ # Is Unbound until set in refactor.RefactoringTool
50
+ future_features: frozenset[Incomplete]
51
+ # Is Unbound until set in pgen2.parse.Parser.pop
52
+ used_names: set[str]
53
+ def __init__(
54
+ self,
55
+ type: int,
56
+ children: Iterable[_NL],
57
+ context: Unused = None,
58
+ prefix: str | None = None,
59
+ fixers_applied: MutableSequence[BaseFix] | None = None,
60
+ ) -> None: ...
61
+ def _eq(self, other: Base) -> bool: ...
62
+ def clone(self) -> Node: ...
63
+ def post_order(self) -> Iterator[Self]: ...
64
+ def pre_order(self) -> Iterator[Self]: ...
65
+ def set_child(self, i: int, child: _NL) -> None: ...
66
+ def insert_child(self, i: int, child: _NL) -> None: ...
67
+ def append_child(self, child: _NL) -> None: ...
68
+ def __unicode__(self) -> str: ...
69
+
70
+ class Leaf(Base):
71
+ lineno: int
72
+ column: int
73
+ value: str
74
+ fixers_applied: MutableSequence[BaseFix]
75
+ def __init__(
76
+ self,
77
+ type: int,
78
+ value: str,
79
+ context: _Context | None = None,
80
+ prefix: str | None = None,
81
+ fixers_applied: MutableSequence[BaseFix] = [],
82
+ ) -> None: ...
83
+ def _eq(self, other: Base) -> bool: ...
84
+ def clone(self) -> Leaf: ...
85
+ def post_order(self) -> Iterator[Self]: ...
86
+ def pre_order(self) -> Iterator[Self]: ...
87
+ def __unicode__(self) -> str: ...
88
+
89
+ def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ...
90
+
91
+ class BasePattern:
92
+ type: int
93
+ content: str | None
94
+ name: str | None
95
+ def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns
96
+ def match(self, node: _NL, results: _Results | None = None) -> bool: ...
97
+ def match_seq(self, nodes: SupportsLenAndGetItem[_NL], results: _Results | None = None) -> bool: ...
98
+ def generate_matches(self, nodes: SupportsGetItem[int, _NL]) -> Iterator[tuple[int, _Results]]: ...
99
+
100
+ class LeafPattern(BasePattern):
101
+ def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ...
102
+
103
+ class NodePattern(BasePattern):
104
+ wildcards: bool
105
+ def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ...
106
+
107
+ class WildcardPattern(BasePattern):
108
+ min: int
109
+ max: int
110
+ def __init__(self, content: str | None = None, min: int = 0, max: int = 0x7FFFFFFF, name: str | None = None) -> None: ...
111
+
112
+ class NegatedPattern(BasePattern):
113
+ def __init__(self, content: str | None = None) -> None: ...
114
+
115
+ def generate_matches(
116
+ patterns: SupportsGetItem[int | slice, BasePattern] | None, nodes: SupportsGetItem[int | slice, _NL]
117
+ ) -> Iterator[tuple[int, _Results]]: ...