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], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
\r
12 def copy_location(new_node: AST, old_node: AST) -> AST: ...
\r
13 def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
\r
14 def fix_missing_locations(node: AST) -> AST: ...
\r
15 def get_docstring(node: AST, clean: bool = ...) -> Optional[bytes]: ...
\r
16 def increment_lineno(node: AST, n: int = ...) -> AST: ...
\r
17 def iter_child_nodes(node: AST) -> Iterator[AST]: ...
\r
18 def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
\r
19 def literal_eval(node_or_string: Union[str, AST]) -> Any: ...
\r
20 def walk(node: AST) -> Iterator[AST]: ...
\r
22 PyCF_ONLY_AST = ... # type: int
\r
29 _attributes = ... # type: typing.Tuple[str, ...]
\r
30 _fields = ... # type: typing.Tuple[str, ...]
\r
31 def __init__(self, *args, **kwargs) -> None: ...
\r
37 body = ... # type: typing.List[stmt]
\r
38 type_ignores = ... # type: typing.List[TypeIgnore]
\r
40 class Interactive(mod):
\r
41 body = ... # type: typing.List[stmt]
\r
43 class Expression(mod):
\r
44 body = ... # type: expr
\r
46 class FunctionType(mod):
\r
47 argtypes = ... # type: typing.List[expr]
\r
48 returns = ... # type: expr
\r
51 body = ... # type: typing.List[stmt]
\r
55 lineno = ... # type: int
\r
56 col_offset = ... # type: int
\r
58 class FunctionDef(stmt):
\r
59 name = ... # type: identifier
\r
60 args = ... # type: arguments
\r
61 body = ... # type: typing.List[stmt]
\r
62 decorator_list = ... # type: typing.List[expr]
\r
63 type_comment = ... # type: Optional[str]
\r
65 class ClassDef(stmt):
\r
66 name = ... # type: identifier
\r
67 bases = ... # type: typing.List[expr]
\r
68 body = ... # type: typing.List[stmt]
\r
69 decorator_list = ... # type: typing.List[expr]
\r
72 value = ... # type: Optional[expr]
\r
75 targets = ... # type: typing.List[expr]
\r
78 targets = ... # type: typing.List[expr]
\r
79 value = ... # type: expr
\r
80 type_comment = ... # type: Optional[str]
\r
82 class AugAssign(stmt):
\r
83 target = ... # type: expr
\r
84 op = ... # type: operator
\r
85 value = ... # type: expr
\r
88 dest = ... # type: Optional[expr]
\r
89 values = ... # type: typing.List[expr]
\r
90 nl = ... # type: bool
\r
93 target = ... # type: expr
\r
94 iter = ... # type: expr
\r
95 body = ... # type: typing.List[stmt]
\r
96 orelse = ... # type: typing.List[stmt]
\r
97 type_comment = ... # type: Optional[str]
\r
100 test = ... # type: expr
\r
101 body = ... # type: typing.List[stmt]
\r
102 orelse = ... # type: typing.List[stmt]
\r
105 test = ... # type: expr
\r
106 body = ... # type: typing.List[stmt]
\r
107 orelse = ... # type: typing.List[stmt]
\r
110 context_expr = ... # type: expr
\r
111 optional_vars = ... # type: Optional[expr]
\r
112 body = ... # type: typing.List[stmt]
\r
113 type_comment = ... # type: Optional[str]
\r
116 type = ... # type: Optional[expr]
\r
117 inst = ... # type: Optional[expr]
\r
118 tback = ... # type: Optional[expr]
\r
120 class TryExcept(stmt):
\r
121 body = ... # type: typing.List[stmt]
\r
122 handlers = ... # type: typing.List[ExceptHandler]
\r
123 orelse = ... # type: typing.List[stmt]
\r
125 class TryFinally(stmt):
\r
126 body = ... # type: typing.List[stmt]
\r
127 finalbody = ... # type: typing.List[stmt]
\r
129 class Assert(stmt):
\r
130 test = ... # type: expr
\r
131 msg = ... # type: Optional[expr]
\r
133 class Import(stmt):
\r
134 names = ... # type: typing.List[alias]
\r
136 class ImportFrom(stmt):
\r
137 module = ... # type: Optional[identifier]
\r
138 names = ... # type: typing.List[alias]
\r
139 level = ... # type: Optional[int]
\r
142 body = ... # type: expr
\r
143 globals = ... # type: Optional[expr]
\r
144 locals = ... # type: Optional[expr]
\r
146 class Global(stmt):
\r
147 names = ... # type: typing.List[identifier]
\r
150 value = ... # type: expr
\r
152 class Pass(stmt): ...
\r
153 class Break(stmt): ...
\r
154 class Continue(stmt): ...
\r
160 _slice = slice # this lets us type the variable named 'slice' below
\r
162 class Slice(slice):
\r
163 lower = ... # type: Optional[expr]
\r
164 upper = ... # type: Optional[expr]
\r
165 step = ... # type: Optional[expr]
\r
167 class ExtSlice(slice):
\r
168 dims = ... # type: typing.List[slice]
\r
170 class Index(slice):
\r
171 value = ... # type: expr
\r
173 class Ellipsis(slice): ...
\r
177 lineno = ... # type: int
\r
178 col_offset = ... # type: int
\r
180 class BoolOp(expr):
\r
181 op = ... # type: boolop
\r
182 values = ... # type: typing.List[expr]
\r
185 left = ... # type: expr
\r
186 op = ... # type: operator
\r
187 right = ... # type: expr
\r
189 class UnaryOp(expr):
\r
190 op = ... # type: unaryop
\r
191 operand = ... # type: expr
\r
193 class Lambda(expr):
\r
194 args = ... # type: arguments
\r
195 body = ... # type: expr
\r
198 test = ... # type: expr
\r
199 body = ... # type: expr
\r
200 orelse = ... # type: expr
\r
203 keys = ... # type: typing.List[expr]
\r
204 values = ... # type: typing.List[expr]
\r
207 elts = ... # type: typing.List[expr]
\r
209 class ListComp(expr):
\r
210 elt = ... # type: expr
\r
211 generators = ... # type: typing.List[comprehension]
\r
213 class SetComp(expr):
\r
214 elt = ... # type: expr
\r
215 generators = ... # type: typing.List[comprehension]
\r
217 class DictComp(expr):
\r
218 key = ... # type: expr
\r
219 value = ... # type: expr
\r
220 generators = ... # type: typing.List[comprehension]
\r
222 class GeneratorExp(expr):
\r
223 elt = ... # type: expr
\r
224 generators = ... # type: typing.List[comprehension]
\r
227 value = ... # type: Optional[expr]
\r
229 class Compare(expr):
\r
230 left = ... # type: expr
\r
231 ops = ... # type: typing.List[cmpop]
\r
232 comparators = ... # type: typing.List[expr]
\r
235 func = ... # type: expr
\r
236 args = ... # type: typing.List[expr]
\r
237 keywords = ... # type: typing.List[keyword]
\r
238 starargs = ... # type: Optional[expr]
\r
239 kwargs = ... # type: Optional[expr]
\r
242 value = ... # type: expr
\r
245 n = ... # type: Union[int, float, complex]
\r
248 s = ... # type: bytes
\r
250 class Attribute(expr):
\r
251 value = ... # type: expr
\r
252 attr = ... # type: identifier
\r
253 ctx = ... # type: expr_context
\r
255 class Subscript(expr):
\r
256 value = ... # type: expr
\r
257 slice = ... # type: _slice
\r
258 ctx = ... # type: expr_context
\r
261 id = ... # type: identifier
\r
262 ctx = ... # type: expr_context
\r
265 elts = ... # type: typing.List[expr]
\r
266 ctx = ... # type: expr_context
\r
269 elts = ... # type: typing.List[expr]
\r
270 ctx = ... # type: expr_context
\r
273 class expr_context(AST):
\r
276 class AugLoad(expr_context): ...
\r
277 class AugStore(expr_context): ...
\r
278 class Del(expr_context): ...
\r
279 class Load(expr_context): ...
\r
280 class Param(expr_context): ...
\r
281 class Store(expr_context): ...
\r
287 class And(boolop): ...
\r
288 class Or(boolop): ...
\r
290 class operator(AST):
\r
293 class Add(operator): ...
\r
294 class BitAnd(operator): ...
\r
295 class BitOr(operator): ...
\r
296 class BitXor(operator): ...
\r
297 class Div(operator): ...
\r
298 class FloorDiv(operator): ...
\r
299 class LShift(operator): ...
\r
300 class Mod(operator): ...
\r
301 class Mult(operator): ...
\r
302 class Pow(operator): ...
\r
303 class RShift(operator): ...
\r
304 class Sub(operator): ...
\r
306 class unaryop(AST):
\r
309 class Invert(unaryop): ...
\r
310 class Not(unaryop): ...
\r
311 class UAdd(unaryop): ...
\r
312 class USub(unaryop): ...
\r
317 class Eq(cmpop): ...
\r
318 class Gt(cmpop): ...
\r
319 class GtE(cmpop): ...
\r
320 class In(cmpop): ...
\r
321 class Is(cmpop): ...
\r
322 class IsNot(cmpop): ...
\r
323 class Lt(cmpop): ...
\r
324 class LtE(cmpop): ...
\r
325 class NotEq(cmpop): ...
\r
326 class NotIn(cmpop): ...
\r
329 class comprehension(AST):
\r
330 target = ... # type: expr
\r
331 iter = ... # type: expr
\r
332 ifs = ... # type: typing.List[expr]
\r
335 class ExceptHandler(AST):
\r
336 type = ... # type: Optional[expr]
\r
337 name = ... # type: Optional[expr]
\r
338 body = ... # type: typing.List[stmt]
\r
339 lineno = ... # type: int
\r
340 col_offset = ... # type: int
\r
343 class arguments(AST):
\r
344 args = ... # type: typing.List[expr]
\r
345 vararg = ... # type: Optional[identifier]
\r
346 kwarg = ... # type: Optional[identifier]
\r
347 defaults = ... # type: typing.List[expr]
\r
348 type_comments = ... # type: typing.List[str]
\r
350 class keyword(AST):
\r
351 arg = ... # type: identifier
\r
352 value = ... # type: expr
\r
355 name = ... # type: identifier
\r
356 asname = ... # type: Optional[identifier]
\r
359 class TypeIgnore(AST):
\r
360 lineno = ... # type: int
\r