Undocumented
Function | filter |
Filter the given list of statements to remove ignorable statements. If base_node is not a frame itself and the name is found in the inner frame locals, statements will be filtered to remove ignorable statements according to base_node's location. |
Function | get |
Get the node that assigned the name represented by the node. |
Function | has |
Check if this ast.ClassDef node inherits from the given type. |
Function | optionally |
Whether this node optionally assigns a variable. |
Constant | ASSIGNMENT |
Undocumented |
Constant | CONTAINER |
Undocumented |
Constant | FILTER |
Undocumented |
Constant | OPTIONAL |
Undocumented |
Constant | PARENT |
Undocumented |
Function | _assign |
method used in filter_stmts |
Function | _comprehension |
method used in filter_stmts |
Function | _filter |
method used in _filter_stmts to get statements and trigger break |
Function | _get |
Returns the list of tuples (node, node.statement) for all stmt_nodes. |
Function | _get |
No summary |
Filter the given list of statements to remove ignorable statements. If base_node is not a frame itself and the name is found in the inner frame locals, statements will be filtered to remove ignorable statements according to base_node's location.
Parameters | |
baseASTNode | Undocumented |
stmts:list(ASTNode) | The statements to filter.
This list generally comes from the ASTNode.locals atribute that
maps strings to ast.Name or ast.Attribute |
frame:ASTNode | The frame that all of the given statements belong to. |
offset:int | The line offset to filter statements up to. |
Returns | |
list(ASTNode) | The filtered statements. |
Get the node that assigned the name represented by the node.
For a ast.Name
, return the parent ast.Assign
or ast.AnnAssign
node that define the name.
For others, it return the statement it self.
Parameters | |
node:LocalsAssignT | Undocumented |
Returns | |
ASTNode | Undocumented |
Check if this ast.ClassDef
node inherits from the given type.
Parameters | |
node:ASTNode | The node defining the base to look for.
Usually this is a Name node. |
Returns | |
bool | Undocumented |
Whether this node optionally assigns a variable.
This is for loop assignments because loop won't necessarily perform an assignment if the loop has no iterations.
Returns | |
bool | Undocumented |
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Returns the list of tuples (node, node.statement) for all stmt_nodes.
Special handling for ExceptHandlers, see code comments.
Parameters | |
baseASTNode | Undocumented |
stmtList[ | Undocumented |
Returns | |
List[ | Undocumented |
Parameters | |
self:ASTNode | the assign_type. |
baseASTNode | the lookup context node in which the filtering happends. |
node:LocalsAssignT | the LocalsAssignT node where the node to filter was assigned. |
_stmts:List[ | the already filtered statements (empty list on the first iteration) |
mystmt:Optional[ | the statement of the base node. |
Returns | |
Tuple[ | Undocumented |