class Node: (source)
Known subclasses: pytype.pytd.parse.node_test.Data
, pytype.pytd.parse.node_test.Node1
, pytype.pytd.parse.node_test.Node2
, pytype.pytd.parse.node_test.Node3
, pytype.pytd.parse.node_test.NodeWithVisit
, pytype.pytd.parse.node_test.V
, pytype.pytd.parse.node_test.X
, pytype.pytd.parse.node_test.XY
, pytype.pytd.parse.node_test.Y
, pytype.pytd.pytd.Alias
, pytype.pytd.pytd.Annotated
, pytype.pytd.pytd.AnythingType
, pytype.pytd.pytd.Class
, pytype.pytd.pytd.ClassType
, pytype.pytd.pytd.Constant
, pytype.pytd.pytd.Function
, pytype.pytd.pytd.GenericType
, pytype.pytd.pytd.LateType
, pytype.pytd.pytd.Literal
, pytype.pytd.pytd.Module
, pytype.pytd.pytd.NamedType
, pytype.pytd.pytd.NothingType
, pytype.pytd.pytd.Parameter
, pytype.pytd.pytd.ParamSpecArgs
, pytype.pytd.pytd.ParamSpecKwargs
, pytype.pytd.pytd.Signature
, pytype.pytd.pytd.TemplateItem
, pytype.pytd.pytd.TypeDeclUnit
, pytype.pytd.pytd.TypeParameter
, pytype.pytd.type_match.StrictType
, pytype.pytd.pytd._SetOfTypes
Base Node class.
Method | __ge__ |
Undocumented |
Method | __gt__ |
Larger than other node? Define so we can have deterministic ordering. |
Method | __iter__ |
Undocumented |
Method | __le__ |
Undocumented |
Method | __lt__ |
Smaller than other node? Define so we can have deterministic ordering. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Visitor interface for transforming a tree of nodes to a new tree. |
Class Variable | __slots__ |
Undocumented |
Method | _ |
Returns a tuple of the fields of self as a sort key. |
Class Variable | _name2item |
Undocumented |
pytype.pytd.pytd.TypeParameter
Smaller than other node? Define so we can have deterministic ordering.
Visitor interface for transforming a tree of nodes to a new tree. You can pass a visitor, and callback functions on that visitor will be called for all nodes in the tree. Note that nodes are also allowed to be stored in lists and as the values of dictionaries, as long as these lists/dictionaries are stored in the named fields of the Node class. It's possible to overload the Visit function on Nodes, to do your own processing. Arguments: visitor: An instance of a visitor for this tree. For every node type you want to transform, this visitor implements a "Visit<Classname>" function named after the class of the node this function should target. Note that <Classname> is the *actual* class of the node, so if you subclass a Node class, visitors for the superclasses will *not* be triggered anymore. Also, visitor callbacks are only triggered for subclasses of Node. *args: Passed to the visitor callback. **kwargs: Passed to the visitor callback. Returns: Transformed version of this node.