1 # This file describes the nodes of the AST in ast.py. The module is
2 # generated by astgen.py.
3 # The descriptions use the following special notation to describe
4 # properties of the children:
5 # * this child is not a node
6 # ! this child is a sequence that contains nodes in it
7 # & this child may be set to None
8 # = ... a default value for the node constructor (optional args)
10 # If you add node types here, please be sure to update the list of
11 # Node types in Doc/lib/asttable.tex.
15 Function: decorators&, name*, argnames*, defaults!, flags*, doc*, code
16 Lambda: argnames*, defaults!, flags*, code
17 Class: name*, bases!, doc*, code
21 For: assign, list, body, else_&
22 While: test, body, else_&
24 Exec: expr, locals&, globals&
25 From: modname*, names*
27 Raise: expr1&, expr2&, expr3&
28 TryFinally: body, final
29 TryExcept: body, handlers!, else_&
34 Printnl: nodes!, dest&
36 AugAssign: node, op*, expr
40 AssName: name*, flags*
41 AssAttr: expr, attrname*, flags*
42 ListComp: expr, quals!
43 ListCompFor: assign, list, ifs!
46 GenExprInner: expr, quals!
47 GenExprFor: assign, iter, ifs!
56 Getattr: expr, attrname*
57 CallFunc: node, args!, star_args& = None, dstar_args& = None
59 Subscript: expr, flags*, subs!
62 Slice: expr, flags*, lower&, upper&
70 LeftShift: (left, right)
71 RightShift: (left, right)
78 FloorDiv: (left, right)
84 self.varargs = self.kwargs = None
85 if flags & CO_VARARGS:
87 if flags & CO_VARKEYWORDS:
91 self.varargs = self.kwargs = None
92 if flags & CO_VARARGS:
94 if flags & CO_VARKEYWORDS:
98 self.argnames = ['[outmost-iterable]']
99 self.varargs = self.kwargs = None
102 self.is_outmost = False