2 from typing import Any, Optional, Union, Generic, Iterator
\r
5 def visit(self, node: AST) -> Any: ...
\r
6 def generic_visit(self, node: AST) -> None: ...
\r
8 class NodeTransformer(NodeVisitor):
\r
9 def generic_visit(self, node: AST) -> None: ...
\r
11 def parse(source: Union[str, bytes],
\r
12 filename: Union[str, bytes] = ...,
\r
14 feature_version: int = ...) -> AST: ...
\r
15 def copy_location(new_node: AST, old_node: AST) -> AST: ...
\r
16 def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
\r
17 def fix_missing_locations(node: AST) -> AST: ...
\r
18 def get_docstring(node: AST, clean: bool = ...) -> str: ...
\r
19 def increment_lineno(node: AST, n: int = ...) -> AST: ...
\r
20 def iter_child_nodes(node: AST) -> Iterator[AST]: ...
\r
21 def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
\r
22 def literal_eval(node_or_string: Union[str, AST]) -> Any: ...
\r
23 def walk(node: AST) -> Iterator[AST]: ...
\r
25 PyCF_ONLY_AST = ... # type: int
\r
32 _attributes = ... # type: typing.Tuple[str, ...]
\r
33 _fields = ... # type: typing.Tuple[str, ...]
\r
34 def __init__(self, *args, **kwargs) -> None: ...
\r
40 body = ... # type: typing.List[stmt]
\r
41 type_ignores = ... # type: typing.List[TypeIgnore]
\r
43 class Interactive(mod):
\r
44 body = ... # type: typing.List[stmt]
\r
46 class Expression(mod):
\r
47 body = ... # type: expr
\r
49 class FunctionType(mod):
\r
50 argtypes = ... # type: typing.List[expr]
\r
51 returns = ... # type: expr
\r
54 body = ... # type: typing.List[stmt]
\r
58 lineno = ... # type: int
\r
59 col_offset = ... # type: int
\r
61 class FunctionDef(stmt):
\r
62 name = ... # type: identifier
\r
63 args = ... # type: arguments
\r
64 body = ... # type: typing.List[stmt]
\r
65 decorator_list = ... # type: typing.List[expr]
\r
66 returns = ... # type: Optional[expr]
\r
67 type_comment = ... # type: Optional[str]
\r
69 class AsyncFunctionDef(stmt):
\r
70 name = ... # type: identifier
\r
71 args = ... # type: arguments
\r
72 body = ... # type: typing.List[stmt]
\r
73 decorator_list = ... # type: typing.List[expr]
\r
74 returns = ... # type: Optional[expr]
\r
75 type_comment = ... # type: Optional[str]
\r
77 class ClassDef(stmt):
\r
78 name = ... # type: identifier
\r
79 bases = ... # type: typing.List[expr]
\r
80 keywords = ... # type: typing.List[keyword]
\r
81 body = ... # type: typing.List[stmt]
\r
82 decorator_list = ... # type: typing.List[expr]
\r
85 value = ... # type: Optional[expr]
\r
88 targets = ... # type: typing.List[expr]
\r
91 targets = ... # type: typing.List[expr]
\r
92 value = ... # type: expr
\r
93 type_comment = ... # type: Optional[str]
\r
95 class AugAssign(stmt):
\r
96 target = ... # type: expr
\r
97 op = ... # type: operator
\r
98 value = ... # type: expr
\r
100 class AnnAssign(stmt):
\r
101 target = ... # type: expr
\r
102 annotation = ... # type: expr
\r
103 value = ... # type: Optional[expr]
\r
104 simple = ... # type: int
\r
107 target = ... # type: expr
\r
108 iter = ... # type: expr
\r
109 body = ... # type: typing.List[stmt]
\r
110 orelse = ... # type: typing.List[stmt]
\r
111 type_comment = ... # type: Optional[str]
\r
113 class AsyncFor(stmt):
\r
114 target = ... # type: expr
\r
115 iter = ... # type: expr
\r
116 body = ... # type: typing.List[stmt]
\r
117 orelse = ... # type: typing.List[stmt]
\r
118 type_comment = ... # type: Optional[str]
\r
121 test = ... # type: expr
\r
122 body = ... # type: typing.List[stmt]
\r
123 orelse = ... # type: typing.List[stmt]
\r
126 test = ... # type: expr
\r
127 body = ... # type: typing.List[stmt]
\r
128 orelse = ... # type: typing.List[stmt]
\r
131 items = ... # type: typing.List[withitem]
\r
132 body = ... # type: typing.List[stmt]
\r
133 type_comment = ... # type: Optional[str]
\r
135 class AsyncWith(stmt):
\r
136 items = ... # type: typing.List[withitem]
\r
137 body = ... # type: typing.List[stmt]
\r
138 type_comment = ... # type: Optional[str]
\r
141 exc = ... # type: Optional[expr]
\r
142 cause = ... # type: Optional[expr]
\r
145 body = ... # type: typing.List[stmt]
\r
146 handlers = ... # type: typing.List[ExceptHandler]
\r
147 orelse = ... # type: typing.List[stmt]
\r
148 finalbody = ... # type: typing.List[stmt]
\r
150 class Assert(stmt):
\r
151 test = ... # type: expr
\r
152 msg = ... # type: Optional[expr]
\r
154 class Import(stmt):
\r
155 names = ... # type: typing.List[alias]
\r
157 class ImportFrom(stmt):
\r
158 module = ... # type: Optional[identifier]
\r
159 names = ... # type: typing.List[alias]
\r
160 level = ... # type: Optional[int]
\r
162 class Global(stmt):
\r
163 names = ... # type: typing.List[identifier]
\r
165 class Nonlocal(stmt):
\r
166 names = ... # type: typing.List[identifier]
\r
169 value = ... # type: expr
\r
171 class Pass(stmt): ...
\r
172 class Break(stmt): ...
\r
173 class Continue(stmt): ...
\r
179 _slice = slice # this lets us type the variable named 'slice' below
\r
181 class Slice(slice):
\r
182 lower = ... # type: Optional[expr]
\r
183 upper = ... # type: Optional[expr]
\r
184 step = ... # type: Optional[expr]
\r
186 class ExtSlice(slice):
\r
187 dims = ... # type: typing.List[slice]
\r
189 class Index(slice):
\r
190 value = ... # type: expr
\r
194 lineno = ... # type: int
\r
195 col_offset = ... # type: int
\r
197 class BoolOp(expr):
\r
198 op = ... # type: boolop
\r
199 values = ... # type: typing.List[expr]
\r
202 left = ... # type: expr
\r
203 op = ... # type: operator
\r
204 right = ... # type: expr
\r
206 class UnaryOp(expr):
\r
207 op = ... # type: unaryop
\r
208 operand = ... # type: expr
\r
210 class Lambda(expr):
\r
211 args = ... # type: arguments
\r
212 body = ... # type: expr
\r
215 test = ... # type: expr
\r
216 body = ... # type: expr
\r
217 orelse = ... # type: expr
\r
220 keys = ... # type: typing.List[expr]
\r
221 values = ... # type: typing.List[expr]
\r
224 elts = ... # type: typing.List[expr]
\r
226 class ListComp(expr):
\r
227 elt = ... # type: expr
\r
228 generators = ... # type: typing.List[comprehension]
\r
230 class SetComp(expr):
\r
231 elt = ... # type: expr
\r
232 generators = ... # type: typing.List[comprehension]
\r
234 class DictComp(expr):
\r
235 key = ... # type: expr
\r
236 value = ... # type: expr
\r
237 generators = ... # type: typing.List[comprehension]
\r
239 class GeneratorExp(expr):
\r
240 elt = ... # type: expr
\r
241 generators = ... # type: typing.List[comprehension]
\r
244 value = ... # type: expr
\r
247 value = ... # type: Optional[expr]
\r
249 class YieldFrom(expr):
\r
250 value = ... # type: expr
\r
252 class Compare(expr):
\r
253 left = ... # type: expr
\r
254 ops = ... # type: typing.List[cmpop]
\r
255 comparators = ... # type: typing.List[expr]
\r
258 func = ... # type: expr
\r
259 args = ... # type: typing.List[expr]
\r
260 keywords = ... # type: typing.List[keyword]
\r
263 n = ... # type: Union[int, float]
\r
266 s = ... # type: str
\r
268 class FormattedValue(expr):
\r
269 value = ... # type: expr
\r
270 conversion = ... # type: typing.Optional[int]
\r
271 format_spec = ... # type: typing.Optional[expr]
\r
273 class JoinedStr(expr):
\r
274 values = ... # type: typing.List[expr]
\r
277 s = ... # type: bytes
\r
279 class NameConstant(expr):
\r
280 value = ... # type: Any
\r
282 class Ellipsis(expr): ...
\r
284 class Attribute(expr):
\r
285 value = ... # type: expr
\r
286 attr = ... # type: identifier
\r
287 ctx = ... # type: expr_context
\r
289 class Subscript(expr):
\r
290 value = ... # type: expr
\r
291 slice = ... # type: _slice
\r
292 ctx = ... # type: expr_context
\r
294 class Starred(expr):
\r
295 value = ... # type: expr
\r
296 ctx = ... # type: expr_context
\r
299 id = ... # type: identifier
\r
300 ctx = ... # type: expr_context
\r
303 elts = ... # type: typing.List[expr]
\r
304 ctx = ... # type: expr_context
\r
307 elts = ... # type: typing.List[expr]
\r
308 ctx = ... # type: expr_context
\r
311 class expr_context(AST):
\r
314 class AugLoad(expr_context): ...
\r
315 class AugStore(expr_context): ...
\r
316 class Del(expr_context): ...
\r
317 class Load(expr_context): ...
\r
318 class Param(expr_context): ...
\r
319 class Store(expr_context): ...
\r
325 class And(boolop): ...
\r
326 class Or(boolop): ...
\r
328 class operator(AST):
\r
331 class Add(operator): ...
\r
332 class BitAnd(operator): ...
\r
333 class BitOr(operator): ...
\r
334 class BitXor(operator): ...
\r
335 class Div(operator): ...
\r
336 class FloorDiv(operator): ...
\r
337 class LShift(operator): ...
\r
338 class Mod(operator): ...
\r
339 class Mult(operator): ...
\r
340 class MatMult(operator): ...
\r
341 class Pow(operator): ...
\r
342 class RShift(operator): ...
\r
343 class Sub(operator): ...
\r
345 class unaryop(AST):
\r
348 class Invert(unaryop): ...
\r
349 class Not(unaryop): ...
\r
350 class UAdd(unaryop): ...
\r
351 class USub(unaryop): ...
\r
356 class Eq(cmpop): ...
\r
357 class Gt(cmpop): ...
\r
358 class GtE(cmpop): ...
\r
359 class In(cmpop): ...
\r
360 class Is(cmpop): ...
\r
361 class IsNot(cmpop): ...
\r
362 class Lt(cmpop): ...
\r
363 class LtE(cmpop): ...
\r
364 class NotEq(cmpop): ...
\r
365 class NotIn(cmpop): ...
\r
368 class comprehension(AST):
\r
369 target = ... # type: expr
\r
370 iter = ... # type: expr
\r
371 ifs = ... # type: typing.List[expr]
\r
372 is_async = ... # type: int
\r
375 class ExceptHandler(AST):
\r
376 type = ... # type: Optional[expr]
\r
377 name = ... # type: Optional[identifier]
\r
378 body = ... # type: typing.List[stmt]
\r
379 lineno = ... # type: int
\r
380 col_offset = ... # type: int
\r
383 class arguments(AST):
\r
384 args = ... # type: typing.List[arg]
\r
385 vararg = ... # type: Optional[arg]
\r
386 kwonlyargs = ... # type: typing.List[arg]
\r
387 kw_defaults = ... # type: typing.List[expr]
\r
388 kwarg = ... # type: Optional[arg]
\r
389 defaults = ... # type: typing.List[expr]
\r
392 arg = ... # type: identifier
\r
393 annotation = ... # type: Optional[expr]
\r
394 lineno = ... # type: int
\r
395 col_offset = ... # type: int
\r
396 type_comment = ... # type: typing.Optional[str]
\r
398 class keyword(AST):
\r
399 arg = ... # type: Optional[identifier]
\r
400 value = ... # type: expr
\r
403 name = ... # type: identifier
\r
404 asname = ... # type: Optional[identifier]
\r
406 class withitem(AST):
\r
407 context_expr = ... # type: expr
\r
408 optional_vars = ... # type: Optional[expr]
\r
411 class TypeIgnore(AST):
\r
412 lineno = ... # type: int
\r