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.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.LICENSE.txt +42 -0
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/stdlib/_asyncio.pyi +3 -25
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +4 -44
- package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_csv.pyi +2 -16
- package/dist/typeshed-fallback/stdlib/_dbm.pyi +1 -13
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +1 -8
- package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +164 -180
- package/dist/typeshed-fallback/stdlib/_gdbm.pyi +1 -39
- package/dist/typeshed-fallback/stdlib/_hashlib.pyi +7 -28
- package/dist/typeshed-fallback/stdlib/_imp.pyi +1 -3
- package/dist/typeshed-fallback/stdlib/_msi.pyi +92 -94
- package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +6 -48
- package/dist/typeshed-fallback/stdlib/_ssl.pyi +1 -8
- package/dist/typeshed-fallback/stdlib/_thread.pyi +1 -8
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/aifc.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/array.pyi +3 -17
- package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +4 -23
- package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/audioop.pyi +43 -95
- package/dist/typeshed-fallback/stdlib/binascii.pyi +5 -15
- package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/builtins.pyi +8 -106
- package/dist/typeshed-fallback/stdlib/cgi.pyi +118 -118
- package/dist/typeshed-fallback/stdlib/cgitb.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/chunk.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/datetime.pyi +4 -12
- package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/distutils/_msvccompiler.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
- package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +176 -176
- package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +229 -229
- package/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi +48 -48
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +22 -22
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +46 -46
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +29 -29
- package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +52 -52
- package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +40 -40
- package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
- package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +71 -71
- package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/core.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +317 -317
- package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
- package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/log.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/util.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/distutils/version.pyi +36 -38
- package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/encodings/mac_centeuro.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
- package/dist/typeshed-fallback/stdlib/hmac.pyi +2 -30
- package/dist/typeshed-fallback/stdlib/imghdr.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +7 -36
- package/dist/typeshed-fallback/stdlib/lib2to3/btm_matcher.pyi +28 -28
- package/dist/typeshed-fallback/stdlib/lib2to3/fixer_base.pyi +42 -42
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_apply.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_dict.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_exec.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_filter.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_future.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports2.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_input.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_intern.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_long.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_map.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_ne.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_next.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_operator.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_paren.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_print.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_raise.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_reload.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_repr.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_throw.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_tuple_params.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_types.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/lib2to3/fixes/fix_zip.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/main.pyi +42 -42
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/__init__.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi +24 -24
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/literals.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/token.pyi +69 -69
- package/dist/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi +96 -96
- package/dist/typeshed-fallback/stdlib/lib2to3/pygram.pyi +114 -114
- package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +117 -127
- package/dist/typeshed-fallback/stdlib/lib2to3/refactor.pyi +82 -82
- package/dist/typeshed-fallback/stdlib/mailcap.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/marshal.pyi +4 -52
- package/dist/typeshed-fallback/stdlib/math.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
- package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/nis.pyi +4 -31
- package/dist/typeshed-fallback/stdlib/nntplib.pyi +125 -125
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +1 -8
- package/dist/typeshed-fallback/stdlib/parser.pyi +24 -55
- package/dist/typeshed-fallback/stdlib/pipes.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/sndhdr.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/spwd.pyi +13 -66
- package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/ssl.pyi +0 -4
- package/dist/typeshed-fallback/stdlib/sunau.pyi +86 -86
- package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +4 -40
- package/dist/typeshed-fallback/stdlib/telnetlib.pyi +123 -123
- package/dist/typeshed-fallback/stdlib/tkinter/tix.pyi +299 -299
- package/dist/typeshed-fallback/stdlib/types.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/typing.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +544 -559
- package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +1 -6
- package/dist/typeshed-fallback/stdlib/uu.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/xdrlib.pyi +57 -57
- package/dist/typeshed-fallback/stdlib/xxlimited.pyi +1 -3
- package/dist/typeshed-fallback/stdlib/zipimport.pyi +0 -29
- package/dist/typeshed-fallback/stdlib/zlib.pyi +1 -10
- package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +3 -9
- 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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def
|
|
96
|
-
def
|
|
97
|
-
def
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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]]: ...
|