basedpyright 1.12.6 → 1.13.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.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
- package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
- package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
- package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
- package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
- package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
- package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
- package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
- package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
- package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
- package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
- package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
- package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
- package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
- package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
- package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
- package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
- package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
- package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
- package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
- package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
- package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
- package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
- package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
- package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
- package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
- package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
- package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
- package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
- package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
- package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
- package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
- package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
- package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
- package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
- package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
- package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
- package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
- package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
- package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
- package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
- package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
- package/package.json +1 -1
|
@@ -34,10 +34,20 @@ class AST:
|
|
|
34
34
|
if sys.version_info >= (3, 13):
|
|
35
35
|
_field_types: ClassVar[dict[str, Any]]
|
|
36
36
|
|
|
37
|
-
class mod(AST):
|
|
38
|
-
|
|
37
|
+
class mod(AST):
|
|
38
|
+
"""
|
|
39
|
+
mod = Module(stmt* body, type_ignore* type_ignores)
|
|
40
|
+
| Interactive(stmt* body)
|
|
41
|
+
| Expression(expr body)
|
|
42
|
+
| FunctionType(expr* argtypes, expr returns)
|
|
43
|
+
"""
|
|
44
|
+
...
|
|
45
|
+
class type_ignore(AST):
|
|
46
|
+
"""type_ignore = TypeIgnore(int lineno, string tag)"""
|
|
47
|
+
...
|
|
39
48
|
|
|
40
49
|
class TypeIgnore(type_ignore):
|
|
50
|
+
"""TypeIgnore(int lineno, string tag)"""
|
|
41
51
|
if sys.version_info >= (3, 10):
|
|
42
52
|
__match_args__ = ("lineno", "tag")
|
|
43
53
|
lineno: int
|
|
@@ -45,6 +55,7 @@ class TypeIgnore(type_ignore):
|
|
|
45
55
|
def __init__(self, lineno: int, tag: str) -> None: ...
|
|
46
56
|
|
|
47
57
|
class FunctionType(mod):
|
|
58
|
+
"""FunctionType(expr* argtypes, expr returns)"""
|
|
48
59
|
if sys.version_info >= (3, 10):
|
|
49
60
|
__match_args__ = ("argtypes", "returns")
|
|
50
61
|
argtypes: list[expr]
|
|
@@ -58,6 +69,7 @@ class FunctionType(mod):
|
|
|
58
69
|
def __init__(self, argtypes: list[expr], returns: expr) -> None: ...
|
|
59
70
|
|
|
60
71
|
class Module(mod):
|
|
72
|
+
"""Module(stmt* body, type_ignore* type_ignores)"""
|
|
61
73
|
if sys.version_info >= (3, 10):
|
|
62
74
|
__match_args__ = ("body", "type_ignores")
|
|
63
75
|
body: list[stmt]
|
|
@@ -68,6 +80,7 @@ class Module(mod):
|
|
|
68
80
|
def __init__(self, body: list[stmt], type_ignores: list[TypeIgnore]) -> None: ...
|
|
69
81
|
|
|
70
82
|
class Interactive(mod):
|
|
83
|
+
"""Interactive(stmt* body)"""
|
|
71
84
|
if sys.version_info >= (3, 10):
|
|
72
85
|
__match_args__ = ("body",)
|
|
73
86
|
body: list[stmt]
|
|
@@ -77,12 +90,40 @@ class Interactive(mod):
|
|
|
77
90
|
def __init__(self, body: list[stmt]) -> None: ...
|
|
78
91
|
|
|
79
92
|
class Expression(mod):
|
|
93
|
+
"""Expression(expr body)"""
|
|
80
94
|
if sys.version_info >= (3, 10):
|
|
81
95
|
__match_args__ = ("body",)
|
|
82
96
|
body: expr
|
|
83
97
|
def __init__(self, body: expr) -> None: ...
|
|
84
98
|
|
|
85
99
|
class stmt(AST):
|
|
100
|
+
"""
|
|
101
|
+
stmt = FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)
|
|
102
|
+
| AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)
|
|
103
|
+
| ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)
|
|
104
|
+
| Return(expr? value)
|
|
105
|
+
| Delete(expr* targets)
|
|
106
|
+
| Assign(expr* targets, expr value, string? type_comment)
|
|
107
|
+
| AugAssign(expr target, operator op, expr value)
|
|
108
|
+
| AnnAssign(expr target, expr annotation, expr? value, int simple)
|
|
109
|
+
| For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
|
|
110
|
+
| AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
|
|
111
|
+
| While(expr test, stmt* body, stmt* orelse)
|
|
112
|
+
| If(expr test, stmt* body, stmt* orelse)
|
|
113
|
+
| With(withitem* items, stmt* body, string? type_comment)
|
|
114
|
+
| AsyncWith(withitem* items, stmt* body, string? type_comment)
|
|
115
|
+
| Raise(expr? exc, expr? cause)
|
|
116
|
+
| Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
|
|
117
|
+
| Assert(expr test, expr? msg)
|
|
118
|
+
| Import(alias* names)
|
|
119
|
+
| ImportFrom(identifier? module, alias* names, int? level)
|
|
120
|
+
| Global(identifier* names)
|
|
121
|
+
| Nonlocal(identifier* names)
|
|
122
|
+
| Expr(expr value)
|
|
123
|
+
| Pass
|
|
124
|
+
| Break
|
|
125
|
+
| Continue
|
|
126
|
+
"""
|
|
86
127
|
lineno: int
|
|
87
128
|
col_offset: int
|
|
88
129
|
end_lineno: int | None
|
|
@@ -90,6 +131,7 @@ class stmt(AST):
|
|
|
90
131
|
def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
91
132
|
|
|
92
133
|
class FunctionDef(stmt):
|
|
134
|
+
"""FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"""
|
|
93
135
|
if sys.version_info >= (3, 12):
|
|
94
136
|
__match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params")
|
|
95
137
|
elif sys.version_info >= (3, 10):
|
|
@@ -153,6 +195,7 @@ class FunctionDef(stmt):
|
|
|
153
195
|
) -> None: ...
|
|
154
196
|
|
|
155
197
|
class AsyncFunctionDef(stmt):
|
|
198
|
+
"""AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"""
|
|
156
199
|
if sys.version_info >= (3, 12):
|
|
157
200
|
__match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params")
|
|
158
201
|
elif sys.version_info >= (3, 10):
|
|
@@ -216,6 +259,7 @@ class AsyncFunctionDef(stmt):
|
|
|
216
259
|
) -> None: ...
|
|
217
260
|
|
|
218
261
|
class ClassDef(stmt):
|
|
262
|
+
"""ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)"""
|
|
219
263
|
if sys.version_info >= (3, 12):
|
|
220
264
|
__match_args__ = ("name", "bases", "keywords", "body", "decorator_list", "type_params")
|
|
221
265
|
elif sys.version_info >= (3, 10):
|
|
@@ -261,12 +305,14 @@ class ClassDef(stmt):
|
|
|
261
305
|
) -> None: ...
|
|
262
306
|
|
|
263
307
|
class Return(stmt):
|
|
308
|
+
"""Return(expr? value)"""
|
|
264
309
|
if sys.version_info >= (3, 10):
|
|
265
310
|
__match_args__ = ("value",)
|
|
266
311
|
value: expr | None
|
|
267
312
|
def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
268
313
|
|
|
269
314
|
class Delete(stmt):
|
|
315
|
+
"""Delete(expr* targets)"""
|
|
270
316
|
if sys.version_info >= (3, 10):
|
|
271
317
|
__match_args__ = ("targets",)
|
|
272
318
|
targets: list[expr]
|
|
@@ -276,6 +322,7 @@ class Delete(stmt):
|
|
|
276
322
|
def __init__(self, targets: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
277
323
|
|
|
278
324
|
class Assign(stmt):
|
|
325
|
+
"""Assign(expr* targets, expr value, string? type_comment)"""
|
|
279
326
|
if sys.version_info >= (3, 10):
|
|
280
327
|
__match_args__ = ("targets", "value", "type_comment")
|
|
281
328
|
targets: list[expr]
|
|
@@ -296,6 +343,7 @@ class Assign(stmt):
|
|
|
296
343
|
) -> None: ...
|
|
297
344
|
|
|
298
345
|
class AugAssign(stmt):
|
|
346
|
+
"""AugAssign(expr target, operator op, expr value)"""
|
|
299
347
|
if sys.version_info >= (3, 10):
|
|
300
348
|
__match_args__ = ("target", "op", "value")
|
|
301
349
|
target: Name | Attribute | Subscript
|
|
@@ -306,6 +354,7 @@ class AugAssign(stmt):
|
|
|
306
354
|
) -> None: ...
|
|
307
355
|
|
|
308
356
|
class AnnAssign(stmt):
|
|
357
|
+
"""AnnAssign(expr target, expr annotation, expr? value, int simple)"""
|
|
309
358
|
if sys.version_info >= (3, 10):
|
|
310
359
|
__match_args__ = ("target", "annotation", "value", "simple")
|
|
311
360
|
target: Name | Attribute | Subscript
|
|
@@ -333,6 +382,7 @@ class AnnAssign(stmt):
|
|
|
333
382
|
) -> None: ...
|
|
334
383
|
|
|
335
384
|
class For(stmt):
|
|
385
|
+
"""For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"""
|
|
336
386
|
if sys.version_info >= (3, 10):
|
|
337
387
|
__match_args__ = ("target", "iter", "body", "orelse", "type_comment")
|
|
338
388
|
target: expr
|
|
@@ -362,6 +412,7 @@ class For(stmt):
|
|
|
362
412
|
) -> None: ...
|
|
363
413
|
|
|
364
414
|
class AsyncFor(stmt):
|
|
415
|
+
"""AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"""
|
|
365
416
|
if sys.version_info >= (3, 10):
|
|
366
417
|
__match_args__ = ("target", "iter", "body", "orelse", "type_comment")
|
|
367
418
|
target: expr
|
|
@@ -391,6 +442,7 @@ class AsyncFor(stmt):
|
|
|
391
442
|
) -> None: ...
|
|
392
443
|
|
|
393
444
|
class While(stmt):
|
|
445
|
+
"""While(expr test, stmt* body, stmt* orelse)"""
|
|
394
446
|
if sys.version_info >= (3, 10):
|
|
395
447
|
__match_args__ = ("test", "body", "orelse")
|
|
396
448
|
test: expr
|
|
@@ -404,6 +456,7 @@ class While(stmt):
|
|
|
404
456
|
def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
405
457
|
|
|
406
458
|
class If(stmt):
|
|
459
|
+
"""If(expr test, stmt* body, stmt* orelse)"""
|
|
407
460
|
if sys.version_info >= (3, 10):
|
|
408
461
|
__match_args__ = ("test", "body", "orelse")
|
|
409
462
|
test: expr
|
|
@@ -417,6 +470,7 @@ class If(stmt):
|
|
|
417
470
|
def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
418
471
|
|
|
419
472
|
class With(stmt):
|
|
473
|
+
"""With(withitem* items, stmt* body, string? type_comment)"""
|
|
420
474
|
if sys.version_info >= (3, 10):
|
|
421
475
|
__match_args__ = ("items", "body", "type_comment")
|
|
422
476
|
items: list[withitem]
|
|
@@ -436,6 +490,7 @@ class With(stmt):
|
|
|
436
490
|
) -> None: ...
|
|
437
491
|
|
|
438
492
|
class AsyncWith(stmt):
|
|
493
|
+
"""AsyncWith(withitem* items, stmt* body, string? type_comment)"""
|
|
439
494
|
if sys.version_info >= (3, 10):
|
|
440
495
|
__match_args__ = ("items", "body", "type_comment")
|
|
441
496
|
items: list[withitem]
|
|
@@ -455,6 +510,7 @@ class AsyncWith(stmt):
|
|
|
455
510
|
) -> None: ...
|
|
456
511
|
|
|
457
512
|
class Raise(stmt):
|
|
513
|
+
"""Raise(expr? exc, expr? cause)"""
|
|
458
514
|
if sys.version_info >= (3, 10):
|
|
459
515
|
__match_args__ = ("exc", "cause")
|
|
460
516
|
exc: expr | None
|
|
@@ -462,6 +518,7 @@ class Raise(stmt):
|
|
|
462
518
|
def __init__(self, exc: expr | None = None, cause: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
463
519
|
|
|
464
520
|
class Try(stmt):
|
|
521
|
+
"""Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)"""
|
|
465
522
|
if sys.version_info >= (3, 10):
|
|
466
523
|
__match_args__ = ("body", "handlers", "orelse", "finalbody")
|
|
467
524
|
body: list[stmt]
|
|
@@ -489,6 +546,7 @@ class Try(stmt):
|
|
|
489
546
|
|
|
490
547
|
if sys.version_info >= (3, 11):
|
|
491
548
|
class TryStar(stmt):
|
|
549
|
+
"""TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)"""
|
|
492
550
|
__match_args__ = ("body", "handlers", "orelse", "finalbody")
|
|
493
551
|
body: list[stmt]
|
|
494
552
|
handlers: list[ExceptHandler]
|
|
@@ -514,6 +572,7 @@ if sys.version_info >= (3, 11):
|
|
|
514
572
|
) -> None: ...
|
|
515
573
|
|
|
516
574
|
class Assert(stmt):
|
|
575
|
+
"""Assert(expr test, expr? msg)"""
|
|
517
576
|
if sys.version_info >= (3, 10):
|
|
518
577
|
__match_args__ = ("test", "msg")
|
|
519
578
|
test: expr
|
|
@@ -521,6 +580,7 @@ class Assert(stmt):
|
|
|
521
580
|
def __init__(self, test: expr, msg: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
522
581
|
|
|
523
582
|
class Import(stmt):
|
|
583
|
+
"""Import(alias* names)"""
|
|
524
584
|
if sys.version_info >= (3, 10):
|
|
525
585
|
__match_args__ = ("names",)
|
|
526
586
|
names: list[alias]
|
|
@@ -530,6 +590,7 @@ class Import(stmt):
|
|
|
530
590
|
def __init__(self, names: list[alias], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
531
591
|
|
|
532
592
|
class ImportFrom(stmt):
|
|
593
|
+
"""ImportFrom(identifier? module, alias* names, int? level)"""
|
|
533
594
|
if sys.version_info >= (3, 10):
|
|
534
595
|
__match_args__ = ("module", "names", "level")
|
|
535
596
|
module: str | None
|
|
@@ -551,6 +612,7 @@ class ImportFrom(stmt):
|
|
|
551
612
|
) -> None: ...
|
|
552
613
|
|
|
553
614
|
class Global(stmt):
|
|
615
|
+
"""Global(identifier* names)"""
|
|
554
616
|
if sys.version_info >= (3, 10):
|
|
555
617
|
__match_args__ = ("names",)
|
|
556
618
|
names: list[_Identifier]
|
|
@@ -560,6 +622,7 @@ class Global(stmt):
|
|
|
560
622
|
def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
561
623
|
|
|
562
624
|
class Nonlocal(stmt):
|
|
625
|
+
"""Nonlocal(identifier* names)"""
|
|
563
626
|
if sys.version_info >= (3, 10):
|
|
564
627
|
__match_args__ = ("names",)
|
|
565
628
|
names: list[_Identifier]
|
|
@@ -569,16 +632,52 @@ class Nonlocal(stmt):
|
|
|
569
632
|
def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
570
633
|
|
|
571
634
|
class Expr(stmt):
|
|
635
|
+
"""Expr(expr value)"""
|
|
572
636
|
if sys.version_info >= (3, 10):
|
|
573
637
|
__match_args__ = ("value",)
|
|
574
638
|
value: expr
|
|
575
639
|
def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
576
640
|
|
|
577
|
-
class Pass(stmt):
|
|
578
|
-
|
|
579
|
-
|
|
641
|
+
class Pass(stmt):
|
|
642
|
+
"""Pass"""
|
|
643
|
+
...
|
|
644
|
+
class Break(stmt):
|
|
645
|
+
"""Break"""
|
|
646
|
+
...
|
|
647
|
+
class Continue(stmt):
|
|
648
|
+
"""Continue"""
|
|
649
|
+
...
|
|
580
650
|
|
|
581
651
|
class expr(AST):
|
|
652
|
+
"""
|
|
653
|
+
expr = BoolOp(boolop op, expr* values)
|
|
654
|
+
| NamedExpr(expr target, expr value)
|
|
655
|
+
| BinOp(expr left, operator op, expr right)
|
|
656
|
+
| UnaryOp(unaryop op, expr operand)
|
|
657
|
+
| Lambda(arguments args, expr body)
|
|
658
|
+
| IfExp(expr test, expr body, expr orelse)
|
|
659
|
+
| Dict(expr* keys, expr* values)
|
|
660
|
+
| Set(expr* elts)
|
|
661
|
+
| ListComp(expr elt, comprehension* generators)
|
|
662
|
+
| SetComp(expr elt, comprehension* generators)
|
|
663
|
+
| DictComp(expr key, expr value, comprehension* generators)
|
|
664
|
+
| GeneratorExp(expr elt, comprehension* generators)
|
|
665
|
+
| Await(expr value)
|
|
666
|
+
| Yield(expr? value)
|
|
667
|
+
| YieldFrom(expr value)
|
|
668
|
+
| Compare(expr left, cmpop* ops, expr* comparators)
|
|
669
|
+
| Call(expr func, expr* args, keyword* keywords)
|
|
670
|
+
| FormattedValue(expr value, int? conversion, expr? format_spec)
|
|
671
|
+
| JoinedStr(expr* values)
|
|
672
|
+
| Constant(constant value, string? kind)
|
|
673
|
+
| Attribute(expr value, identifier attr, expr_context ctx)
|
|
674
|
+
| Subscript(expr value, expr slice, expr_context ctx)
|
|
675
|
+
| Starred(expr value, expr_context ctx)
|
|
676
|
+
| Name(identifier id, expr_context ctx)
|
|
677
|
+
| List(expr* elts, expr_context ctx)
|
|
678
|
+
| Tuple(expr* elts, expr_context ctx)
|
|
679
|
+
| Slice(expr? lower, expr? upper, expr? step)
|
|
680
|
+
"""
|
|
582
681
|
lineno: int
|
|
583
682
|
col_offset: int
|
|
584
683
|
end_lineno: int | None
|
|
@@ -586,6 +685,7 @@ class expr(AST):
|
|
|
586
685
|
def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
587
686
|
|
|
588
687
|
class BoolOp(expr):
|
|
688
|
+
"""BoolOp(boolop op, expr* values)"""
|
|
589
689
|
if sys.version_info >= (3, 10):
|
|
590
690
|
__match_args__ = ("op", "values")
|
|
591
691
|
op: boolop
|
|
@@ -596,6 +696,7 @@ class BoolOp(expr):
|
|
|
596
696
|
def __init__(self, op: boolop, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
597
697
|
|
|
598
698
|
class BinOp(expr):
|
|
699
|
+
"""BinOp(expr left, operator op, expr right)"""
|
|
599
700
|
if sys.version_info >= (3, 10):
|
|
600
701
|
__match_args__ = ("left", "op", "right")
|
|
601
702
|
left: expr
|
|
@@ -604,6 +705,7 @@ class BinOp(expr):
|
|
|
604
705
|
def __init__(self, left: expr, op: operator, right: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
605
706
|
|
|
606
707
|
class UnaryOp(expr):
|
|
708
|
+
"""UnaryOp(unaryop op, expr operand)"""
|
|
607
709
|
if sys.version_info >= (3, 10):
|
|
608
710
|
__match_args__ = ("op", "operand")
|
|
609
711
|
op: unaryop
|
|
@@ -611,6 +713,7 @@ class UnaryOp(expr):
|
|
|
611
713
|
def __init__(self, op: unaryop, operand: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
612
714
|
|
|
613
715
|
class Lambda(expr):
|
|
716
|
+
"""Lambda(arguments args, expr body)"""
|
|
614
717
|
if sys.version_info >= (3, 10):
|
|
615
718
|
__match_args__ = ("args", "body")
|
|
616
719
|
args: arguments
|
|
@@ -618,6 +721,7 @@ class Lambda(expr):
|
|
|
618
721
|
def __init__(self, args: arguments, body: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
619
722
|
|
|
620
723
|
class IfExp(expr):
|
|
724
|
+
"""IfExp(expr test, expr body, expr orelse)"""
|
|
621
725
|
if sys.version_info >= (3, 10):
|
|
622
726
|
__match_args__ = ("test", "body", "orelse")
|
|
623
727
|
test: expr
|
|
@@ -626,6 +730,7 @@ class IfExp(expr):
|
|
|
626
730
|
def __init__(self, test: expr, body: expr, orelse: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
627
731
|
|
|
628
732
|
class Dict(expr):
|
|
733
|
+
"""Dict(expr* keys, expr* values)"""
|
|
629
734
|
if sys.version_info >= (3, 10):
|
|
630
735
|
__match_args__ = ("keys", "values")
|
|
631
736
|
keys: list[expr | None]
|
|
@@ -636,6 +741,7 @@ class Dict(expr):
|
|
|
636
741
|
def __init__(self, keys: list[expr | None], values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
637
742
|
|
|
638
743
|
class Set(expr):
|
|
744
|
+
"""Set(expr* elts)"""
|
|
639
745
|
if sys.version_info >= (3, 10):
|
|
640
746
|
__match_args__ = ("elts",)
|
|
641
747
|
elts: list[expr]
|
|
@@ -645,6 +751,7 @@ class Set(expr):
|
|
|
645
751
|
def __init__(self, elts: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
646
752
|
|
|
647
753
|
class ListComp(expr):
|
|
754
|
+
"""ListComp(expr elt, comprehension* generators)"""
|
|
648
755
|
if sys.version_info >= (3, 10):
|
|
649
756
|
__match_args__ = ("elt", "generators")
|
|
650
757
|
elt: expr
|
|
@@ -655,6 +762,7 @@ class ListComp(expr):
|
|
|
655
762
|
def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
656
763
|
|
|
657
764
|
class SetComp(expr):
|
|
765
|
+
"""SetComp(expr elt, comprehension* generators)"""
|
|
658
766
|
if sys.version_info >= (3, 10):
|
|
659
767
|
__match_args__ = ("elt", "generators")
|
|
660
768
|
elt: expr
|
|
@@ -665,6 +773,7 @@ class SetComp(expr):
|
|
|
665
773
|
def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
666
774
|
|
|
667
775
|
class DictComp(expr):
|
|
776
|
+
"""DictComp(expr key, expr value, comprehension* generators)"""
|
|
668
777
|
if sys.version_info >= (3, 10):
|
|
669
778
|
__match_args__ = ("key", "value", "generators")
|
|
670
779
|
key: expr
|
|
@@ -678,6 +787,7 @@ class DictComp(expr):
|
|
|
678
787
|
def __init__(self, key: expr, value: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
679
788
|
|
|
680
789
|
class GeneratorExp(expr):
|
|
790
|
+
"""GeneratorExp(expr elt, comprehension* generators)"""
|
|
681
791
|
if sys.version_info >= (3, 10):
|
|
682
792
|
__match_args__ = ("elt", "generators")
|
|
683
793
|
elt: expr
|
|
@@ -688,24 +798,28 @@ class GeneratorExp(expr):
|
|
|
688
798
|
def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
689
799
|
|
|
690
800
|
class Await(expr):
|
|
801
|
+
"""Await(expr value)"""
|
|
691
802
|
if sys.version_info >= (3, 10):
|
|
692
803
|
__match_args__ = ("value",)
|
|
693
804
|
value: expr
|
|
694
805
|
def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
695
806
|
|
|
696
807
|
class Yield(expr):
|
|
808
|
+
"""Yield(expr? value)"""
|
|
697
809
|
if sys.version_info >= (3, 10):
|
|
698
810
|
__match_args__ = ("value",)
|
|
699
811
|
value: expr | None
|
|
700
812
|
def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
701
813
|
|
|
702
814
|
class YieldFrom(expr):
|
|
815
|
+
"""YieldFrom(expr value)"""
|
|
703
816
|
if sys.version_info >= (3, 10):
|
|
704
817
|
__match_args__ = ("value",)
|
|
705
818
|
value: expr
|
|
706
819
|
def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
707
820
|
|
|
708
821
|
class Compare(expr):
|
|
822
|
+
"""Compare(expr left, cmpop* ops, expr* comparators)"""
|
|
709
823
|
if sys.version_info >= (3, 10):
|
|
710
824
|
__match_args__ = ("left", "ops", "comparators")
|
|
711
825
|
left: expr
|
|
@@ -719,6 +833,7 @@ class Compare(expr):
|
|
|
719
833
|
def __init__(self, left: expr, ops: list[cmpop], comparators: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
720
834
|
|
|
721
835
|
class Call(expr):
|
|
836
|
+
"""Call(expr func, expr* args, keyword* keywords)"""
|
|
722
837
|
if sys.version_info >= (3, 10):
|
|
723
838
|
__match_args__ = ("func", "args", "keywords")
|
|
724
839
|
func: expr
|
|
@@ -732,6 +847,7 @@ class Call(expr):
|
|
|
732
847
|
def __init__(self, func: expr, args: list[expr], keywords: list[keyword], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
733
848
|
|
|
734
849
|
class FormattedValue(expr):
|
|
850
|
+
"""FormattedValue(expr value, int? conversion, expr? format_spec)"""
|
|
735
851
|
if sys.version_info >= (3, 10):
|
|
736
852
|
__match_args__ = ("value", "conversion", "format_spec")
|
|
737
853
|
value: expr
|
|
@@ -740,6 +856,7 @@ class FormattedValue(expr):
|
|
|
740
856
|
def __init__(self, value: expr, conversion: int, format_spec: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
741
857
|
|
|
742
858
|
class JoinedStr(expr):
|
|
859
|
+
"""JoinedStr(expr* values)"""
|
|
743
860
|
if sys.version_info >= (3, 10):
|
|
744
861
|
__match_args__ = ("values",)
|
|
745
862
|
values: list[expr]
|
|
@@ -749,6 +866,7 @@ class JoinedStr(expr):
|
|
|
749
866
|
def __init__(self, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
750
867
|
|
|
751
868
|
class Constant(expr):
|
|
869
|
+
"""Constant(constant value, string? kind)"""
|
|
752
870
|
if sys.version_info >= (3, 10):
|
|
753
871
|
__match_args__ = ("value", "kind")
|
|
754
872
|
value: Any # None, str, bytes, bool, int, float, complex, Ellipsis
|
|
@@ -759,6 +877,7 @@ class Constant(expr):
|
|
|
759
877
|
def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
760
878
|
|
|
761
879
|
class NamedExpr(expr):
|
|
880
|
+
"""NamedExpr(expr target, expr value)"""
|
|
762
881
|
if sys.version_info >= (3, 10):
|
|
763
882
|
__match_args__ = ("target", "value")
|
|
764
883
|
target: Name
|
|
@@ -766,6 +885,7 @@ class NamedExpr(expr):
|
|
|
766
885
|
def __init__(self, target: Name, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
767
886
|
|
|
768
887
|
class Attribute(expr):
|
|
888
|
+
"""Attribute(expr value, identifier attr, expr_context ctx)"""
|
|
769
889
|
if sys.version_info >= (3, 10):
|
|
770
890
|
__match_args__ = ("value", "attr", "ctx")
|
|
771
891
|
value: expr
|
|
@@ -783,6 +903,7 @@ else:
|
|
|
783
903
|
class _SliceAttributes(TypedDict): ...
|
|
784
904
|
|
|
785
905
|
class Slice(_Slice):
|
|
906
|
+
"""Slice(expr? lower, expr? upper, expr? step)"""
|
|
786
907
|
if sys.version_info >= (3, 10):
|
|
787
908
|
__match_args__ = ("lower", "upper", "step")
|
|
788
909
|
lower: expr | None
|
|
@@ -802,6 +923,7 @@ if sys.version_info < (3, 9):
|
|
|
802
923
|
def __init__(self, value: expr, **kwargs: Unpack[_SliceAttributes]) -> None: ...
|
|
803
924
|
|
|
804
925
|
class Subscript(expr):
|
|
926
|
+
"""Subscript(expr value, expr slice, expr_context ctx)"""
|
|
805
927
|
if sys.version_info >= (3, 10):
|
|
806
928
|
__match_args__ = ("value", "slice", "ctx")
|
|
807
929
|
value: expr
|
|
@@ -810,6 +932,7 @@ class Subscript(expr):
|
|
|
810
932
|
def __init__(self, value: expr, slice: _Slice, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
|
|
811
933
|
|
|
812
934
|
class Starred(expr):
|
|
935
|
+
"""Starred(expr value, expr_context ctx)"""
|
|
813
936
|
if sys.version_info >= (3, 10):
|
|
814
937
|
__match_args__ = ("value", "ctx")
|
|
815
938
|
value: expr
|
|
@@ -817,6 +940,7 @@ class Starred(expr):
|
|
|
817
940
|
def __init__(self, value: expr, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
|
|
818
941
|
|
|
819
942
|
class Name(expr):
|
|
943
|
+
"""Name(identifier id, expr_context ctx)"""
|
|
820
944
|
if sys.version_info >= (3, 10):
|
|
821
945
|
__match_args__ = ("id", "ctx")
|
|
822
946
|
id: _Identifier
|
|
@@ -824,6 +948,7 @@ class Name(expr):
|
|
|
824
948
|
def __init__(self, id: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
|
|
825
949
|
|
|
826
950
|
class List(expr):
|
|
951
|
+
"""List(expr* elts, expr_context ctx)"""
|
|
827
952
|
if sys.version_info >= (3, 10):
|
|
828
953
|
__match_args__ = ("elts", "ctx")
|
|
829
954
|
elts: list[expr]
|
|
@@ -834,6 +959,7 @@ class List(expr):
|
|
|
834
959
|
def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
|
|
835
960
|
|
|
836
961
|
class Tuple(expr):
|
|
962
|
+
"""Tuple(expr* elts, expr_context ctx)"""
|
|
837
963
|
if sys.version_info >= (3, 10):
|
|
838
964
|
__match_args__ = ("elts", "ctx")
|
|
839
965
|
elts: list[expr]
|
|
@@ -845,7 +971,9 @@ class Tuple(expr):
|
|
|
845
971
|
else:
|
|
846
972
|
def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ...
|
|
847
973
|
|
|
848
|
-
class expr_context(AST):
|
|
974
|
+
class expr_context(AST):
|
|
975
|
+
"""expr_context = Load | Store | Del"""
|
|
976
|
+
...
|
|
849
977
|
|
|
850
978
|
if sys.version_info < (3, 9):
|
|
851
979
|
class AugLoad(expr_context): ...
|
|
@@ -856,44 +984,117 @@ if sys.version_info < (3, 9):
|
|
|
856
984
|
body: list[stmt]
|
|
857
985
|
def __init__(self, body: list[stmt]) -> None: ...
|
|
858
986
|
|
|
859
|
-
class Del(expr_context):
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
class
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
class
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
class
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
class
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
class
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
class
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
class
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
class
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
class
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
class
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
class
|
|
893
|
-
|
|
894
|
-
|
|
987
|
+
class Del(expr_context):
|
|
988
|
+
"""Del"""
|
|
989
|
+
...
|
|
990
|
+
class Load(expr_context):
|
|
991
|
+
"""Load"""
|
|
992
|
+
...
|
|
993
|
+
class Store(expr_context):
|
|
994
|
+
"""Store"""
|
|
995
|
+
...
|
|
996
|
+
class boolop(AST):
|
|
997
|
+
"""boolop = And | Or"""
|
|
998
|
+
...
|
|
999
|
+
class And(boolop):
|
|
1000
|
+
"""And"""
|
|
1001
|
+
...
|
|
1002
|
+
class Or(boolop):
|
|
1003
|
+
"""Or"""
|
|
1004
|
+
...
|
|
1005
|
+
class operator(AST):
|
|
1006
|
+
"""operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift | RShift | BitOr | BitXor | BitAnd | FloorDiv"""
|
|
1007
|
+
...
|
|
1008
|
+
class Add(operator):
|
|
1009
|
+
"""Add"""
|
|
1010
|
+
...
|
|
1011
|
+
class BitAnd(operator):
|
|
1012
|
+
"""BitAnd"""
|
|
1013
|
+
...
|
|
1014
|
+
class BitOr(operator):
|
|
1015
|
+
"""BitOr"""
|
|
1016
|
+
...
|
|
1017
|
+
class BitXor(operator):
|
|
1018
|
+
"""BitXor"""
|
|
1019
|
+
...
|
|
1020
|
+
class Div(operator):
|
|
1021
|
+
"""Div"""
|
|
1022
|
+
...
|
|
1023
|
+
class FloorDiv(operator):
|
|
1024
|
+
"""FloorDiv"""
|
|
1025
|
+
...
|
|
1026
|
+
class LShift(operator):
|
|
1027
|
+
"""LShift"""
|
|
1028
|
+
...
|
|
1029
|
+
class Mod(operator):
|
|
1030
|
+
"""Mod"""
|
|
1031
|
+
...
|
|
1032
|
+
class Mult(operator):
|
|
1033
|
+
"""Mult"""
|
|
1034
|
+
...
|
|
1035
|
+
class MatMult(operator):
|
|
1036
|
+
"""MatMult"""
|
|
1037
|
+
...
|
|
1038
|
+
class Pow(operator):
|
|
1039
|
+
"""Pow"""
|
|
1040
|
+
...
|
|
1041
|
+
class RShift(operator):
|
|
1042
|
+
"""RShift"""
|
|
1043
|
+
...
|
|
1044
|
+
class Sub(operator):
|
|
1045
|
+
"""Sub"""
|
|
1046
|
+
...
|
|
1047
|
+
class unaryop(AST):
|
|
1048
|
+
"""unaryop = Invert | Not | UAdd | USub"""
|
|
1049
|
+
...
|
|
1050
|
+
class Invert(unaryop):
|
|
1051
|
+
"""Invert"""
|
|
1052
|
+
...
|
|
1053
|
+
class Not(unaryop):
|
|
1054
|
+
"""Not"""
|
|
1055
|
+
...
|
|
1056
|
+
class UAdd(unaryop):
|
|
1057
|
+
"""UAdd"""
|
|
1058
|
+
...
|
|
1059
|
+
class USub(unaryop):
|
|
1060
|
+
"""USub"""
|
|
1061
|
+
...
|
|
1062
|
+
class cmpop(AST):
|
|
1063
|
+
"""cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn"""
|
|
1064
|
+
...
|
|
1065
|
+
class Eq(cmpop):
|
|
1066
|
+
"""Eq"""
|
|
1067
|
+
...
|
|
1068
|
+
class Gt(cmpop):
|
|
1069
|
+
"""Gt"""
|
|
1070
|
+
...
|
|
1071
|
+
class GtE(cmpop):
|
|
1072
|
+
"""GtE"""
|
|
1073
|
+
...
|
|
1074
|
+
class In(cmpop):
|
|
1075
|
+
"""In"""
|
|
1076
|
+
...
|
|
1077
|
+
class Is(cmpop):
|
|
1078
|
+
"""Is"""
|
|
1079
|
+
...
|
|
1080
|
+
class IsNot(cmpop):
|
|
1081
|
+
"""IsNot"""
|
|
1082
|
+
...
|
|
1083
|
+
class Lt(cmpop):
|
|
1084
|
+
"""Lt"""
|
|
1085
|
+
...
|
|
1086
|
+
class LtE(cmpop):
|
|
1087
|
+
"""LtE"""
|
|
1088
|
+
...
|
|
1089
|
+
class NotEq(cmpop):
|
|
1090
|
+
"""NotEq"""
|
|
1091
|
+
...
|
|
1092
|
+
class NotIn(cmpop):
|
|
1093
|
+
"""NotIn"""
|
|
1094
|
+
...
|
|
895
1095
|
|
|
896
1096
|
class comprehension(AST):
|
|
1097
|
+
"""comprehension(expr target, expr iter, expr* ifs, int is_async)"""
|
|
897
1098
|
if sys.version_info >= (3, 10):
|
|
898
1099
|
__match_args__ = ("target", "iter", "ifs", "is_async")
|
|
899
1100
|
target: expr
|
|
@@ -909,6 +1110,7 @@ class comprehension(AST):
|
|
|
909
1110
|
def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ...
|
|
910
1111
|
|
|
911
1112
|
class excepthandler(AST):
|
|
1113
|
+
"""excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)"""
|
|
912
1114
|
lineno: int
|
|
913
1115
|
col_offset: int
|
|
914
1116
|
end_lineno: int | None
|
|
@@ -916,6 +1118,7 @@ class excepthandler(AST):
|
|
|
916
1118
|
def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
917
1119
|
|
|
918
1120
|
class ExceptHandler(excepthandler):
|
|
1121
|
+
"""ExceptHandler(expr? type, identifier? name, stmt* body)"""
|
|
919
1122
|
if sys.version_info >= (3, 10):
|
|
920
1123
|
__match_args__ = ("type", "name", "body")
|
|
921
1124
|
type: expr | None
|
|
@@ -936,6 +1139,7 @@ class ExceptHandler(excepthandler):
|
|
|
936
1139
|
) -> None: ...
|
|
937
1140
|
|
|
938
1141
|
class arguments(AST):
|
|
1142
|
+
"""arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)"""
|
|
939
1143
|
if sys.version_info >= (3, 10):
|
|
940
1144
|
__match_args__ = ("posonlyargs", "args", "vararg", "kwonlyargs", "kw_defaults", "kwarg", "defaults")
|
|
941
1145
|
posonlyargs: list[arg]
|
|
@@ -994,6 +1198,7 @@ class arguments(AST):
|
|
|
994
1198
|
) -> None: ...
|
|
995
1199
|
|
|
996
1200
|
class arg(AST):
|
|
1201
|
+
"""arg(identifier arg, expr? annotation, string? type_comment)"""
|
|
997
1202
|
lineno: int
|
|
998
1203
|
col_offset: int
|
|
999
1204
|
end_lineno: int | None
|
|
@@ -1008,6 +1213,7 @@ class arg(AST):
|
|
|
1008
1213
|
) -> None: ...
|
|
1009
1214
|
|
|
1010
1215
|
class keyword(AST):
|
|
1216
|
+
"""keyword(identifier? arg, expr value)"""
|
|
1011
1217
|
lineno: int
|
|
1012
1218
|
col_offset: int
|
|
1013
1219
|
end_lineno: int | None
|
|
@@ -1022,6 +1228,7 @@ class keyword(AST):
|
|
|
1022
1228
|
def __init__(self, arg: _Identifier | None = None, *, value: expr, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
1023
1229
|
|
|
1024
1230
|
class alias(AST):
|
|
1231
|
+
"""alias(identifier name, identifier? asname)"""
|
|
1025
1232
|
lineno: int
|
|
1026
1233
|
col_offset: int
|
|
1027
1234
|
end_lineno: int | None
|
|
@@ -1033,6 +1240,7 @@ class alias(AST):
|
|
|
1033
1240
|
def __init__(self, name: str, asname: _Identifier | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
|
|
1034
1241
|
|
|
1035
1242
|
class withitem(AST):
|
|
1243
|
+
"""withitem(expr context_expr, expr? optional_vars)"""
|
|
1036
1244
|
if sys.version_info >= (3, 10):
|
|
1037
1245
|
__match_args__ = ("context_expr", "optional_vars")
|
|
1038
1246
|
context_expr: expr
|
|
@@ -1041,6 +1249,7 @@ class withitem(AST):
|
|
|
1041
1249
|
|
|
1042
1250
|
if sys.version_info >= (3, 10):
|
|
1043
1251
|
class Match(stmt):
|
|
1252
|
+
"""Match(expr subject, match_case* cases)"""
|
|
1044
1253
|
__match_args__ = ("subject", "cases")
|
|
1045
1254
|
subject: expr
|
|
1046
1255
|
cases: list[match_case]
|
|
@@ -1050,6 +1259,16 @@ if sys.version_info >= (3, 10):
|
|
|
1050
1259
|
def __init__(self, subject: expr, cases: list[match_case], **kwargs: Unpack[_Attributes]) -> None: ...
|
|
1051
1260
|
|
|
1052
1261
|
class pattern(AST):
|
|
1262
|
+
"""
|
|
1263
|
+
pattern = MatchValue(expr value)
|
|
1264
|
+
| MatchSingleton(constant value)
|
|
1265
|
+
| MatchSequence(pattern* patterns)
|
|
1266
|
+
| MatchMapping(expr* keys, pattern* patterns, identifier? rest)
|
|
1267
|
+
| MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)
|
|
1268
|
+
| MatchStar(identifier? name)
|
|
1269
|
+
| MatchAs(pattern? pattern, identifier? name)
|
|
1270
|
+
| MatchOr(pattern* patterns)
|
|
1271
|
+
"""
|
|
1053
1272
|
lineno: int
|
|
1054
1273
|
col_offset: int
|
|
1055
1274
|
end_lineno: int
|
|
@@ -1060,6 +1279,7 @@ if sys.version_info >= (3, 10):
|
|
|
1060
1279
|
_Pattern: typing_extensions.TypeAlias = pattern
|
|
1061
1280
|
|
|
1062
1281
|
class match_case(AST):
|
|
1282
|
+
"""match_case(pattern pattern, expr? guard, stmt* body)"""
|
|
1063
1283
|
__match_args__ = ("pattern", "guard", "body")
|
|
1064
1284
|
pattern: _Pattern
|
|
1065
1285
|
guard: expr | None
|
|
@@ -1073,16 +1293,19 @@ if sys.version_info >= (3, 10):
|
|
|
1073
1293
|
def __init__(self, pattern: _Pattern, guard: expr | None = None, *, body: list[stmt]) -> None: ...
|
|
1074
1294
|
|
|
1075
1295
|
class MatchValue(pattern):
|
|
1296
|
+
"""MatchValue(expr value)"""
|
|
1076
1297
|
__match_args__ = ("value",)
|
|
1077
1298
|
value: expr
|
|
1078
1299
|
def __init__(self, value: expr, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1079
1300
|
|
|
1080
1301
|
class MatchSingleton(pattern):
|
|
1302
|
+
"""MatchSingleton(constant value)"""
|
|
1081
1303
|
__match_args__ = ("value",)
|
|
1082
1304
|
value: Literal[True, False] | None
|
|
1083
1305
|
def __init__(self, value: Literal[True, False] | None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1084
1306
|
|
|
1085
1307
|
class MatchSequence(pattern):
|
|
1308
|
+
"""MatchSequence(pattern* patterns)"""
|
|
1086
1309
|
__match_args__ = ("patterns",)
|
|
1087
1310
|
patterns: list[pattern]
|
|
1088
1311
|
if sys.version_info >= (3, 13):
|
|
@@ -1091,11 +1314,13 @@ if sys.version_info >= (3, 10):
|
|
|
1091
1314
|
def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1092
1315
|
|
|
1093
1316
|
class MatchStar(pattern):
|
|
1317
|
+
"""MatchStar(identifier? name)"""
|
|
1094
1318
|
__match_args__ = ("name",)
|
|
1095
1319
|
name: _Identifier | None
|
|
1096
1320
|
def __init__(self, name: _Identifier | None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1097
1321
|
|
|
1098
1322
|
class MatchMapping(pattern):
|
|
1323
|
+
"""MatchMapping(expr* keys, pattern* patterns, identifier? rest)"""
|
|
1099
1324
|
__match_args__ = ("keys", "patterns", "rest")
|
|
1100
1325
|
keys: list[expr]
|
|
1101
1326
|
patterns: list[pattern]
|
|
@@ -1118,6 +1343,7 @@ if sys.version_info >= (3, 10):
|
|
|
1118
1343
|
) -> None: ...
|
|
1119
1344
|
|
|
1120
1345
|
class MatchClass(pattern):
|
|
1346
|
+
"""MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)"""
|
|
1121
1347
|
__match_args__ = ("cls", "patterns", "kwd_attrs", "kwd_patterns")
|
|
1122
1348
|
cls: expr
|
|
1123
1349
|
patterns: list[pattern]
|
|
@@ -1143,6 +1369,7 @@ if sys.version_info >= (3, 10):
|
|
|
1143
1369
|
) -> None: ...
|
|
1144
1370
|
|
|
1145
1371
|
class MatchAs(pattern):
|
|
1372
|
+
"""MatchAs(pattern? pattern, identifier? name)"""
|
|
1146
1373
|
__match_args__ = ("pattern", "name")
|
|
1147
1374
|
pattern: _Pattern | None
|
|
1148
1375
|
name: _Identifier | None
|
|
@@ -1151,6 +1378,7 @@ if sys.version_info >= (3, 10):
|
|
|
1151
1378
|
) -> None: ...
|
|
1152
1379
|
|
|
1153
1380
|
class MatchOr(pattern):
|
|
1381
|
+
"""MatchOr(pattern* patterns)"""
|
|
1154
1382
|
__match_args__ = ("patterns",)
|
|
1155
1383
|
patterns: list[pattern]
|
|
1156
1384
|
if sys.version_info >= (3, 13):
|
|
@@ -1160,6 +1388,11 @@ if sys.version_info >= (3, 10):
|
|
|
1160
1388
|
|
|
1161
1389
|
if sys.version_info >= (3, 12):
|
|
1162
1390
|
class type_param(AST):
|
|
1391
|
+
"""
|
|
1392
|
+
type_param = TypeVar(identifier name, expr? bound)
|
|
1393
|
+
| ParamSpec(identifier name)
|
|
1394
|
+
| TypeVarTuple(identifier name)
|
|
1395
|
+
"""
|
|
1163
1396
|
lineno: int
|
|
1164
1397
|
col_offset: int
|
|
1165
1398
|
end_lineno: int
|
|
@@ -1167,6 +1400,7 @@ if sys.version_info >= (3, 12):
|
|
|
1167
1400
|
def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1168
1401
|
|
|
1169
1402
|
class TypeVar(type_param):
|
|
1403
|
+
"""TypeVar(identifier name, expr? bound)"""
|
|
1170
1404
|
if sys.version_info >= (3, 13):
|
|
1171
1405
|
__match_args__ = ("name", "bound", "default_value")
|
|
1172
1406
|
else:
|
|
@@ -1186,6 +1420,7 @@ if sys.version_info >= (3, 12):
|
|
|
1186
1420
|
def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1187
1421
|
|
|
1188
1422
|
class ParamSpec(type_param):
|
|
1423
|
+
"""ParamSpec(identifier name)"""
|
|
1189
1424
|
if sys.version_info >= (3, 13):
|
|
1190
1425
|
__match_args__ = ("name", "default_value")
|
|
1191
1426
|
else:
|
|
@@ -1200,6 +1435,7 @@ if sys.version_info >= (3, 12):
|
|
|
1200
1435
|
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1201
1436
|
|
|
1202
1437
|
class TypeVarTuple(type_param):
|
|
1438
|
+
"""TypeVarTuple(identifier name)"""
|
|
1203
1439
|
if sys.version_info >= (3, 13):
|
|
1204
1440
|
__match_args__ = ("name", "default_value")
|
|
1205
1441
|
else:
|
|
@@ -1214,6 +1450,7 @@ if sys.version_info >= (3, 12):
|
|
|
1214
1450
|
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
|
|
1215
1451
|
|
|
1216
1452
|
class TypeAlias(stmt):
|
|
1453
|
+
"""TypeAlias(expr name, type_param* type_params, expr value)"""
|
|
1217
1454
|
__match_args__ = ("name", "type_params", "value")
|
|
1218
1455
|
name: Name
|
|
1219
1456
|
type_params: list[type_param]
|