class documentation
class SetComp(ComprehensionScope): (source)
Constructor: SetComp(lineno, col_offset, parent, end_lineno, end_col_offset)
Class representing an ast.SetComp node.
>>> import astroid >>> node = astroid.extract_node('{thing for thing in things if thing}') >>> node <SetComp l.1 at 0x7f23b2e41898>
| Method | __init__ |
No summary |
| Method | bool |
Determine the boolean value of this node. |
| Method | get |
Undocumented |
| Method | postinit |
Do some setup after initialisation. |
| Instance Variable | elt |
The element that forms the output of the expression. |
| Instance Variable | generators |
The generators that are looped through. |
| Instance Variable | locals |
A map of the name of a local variable to the node defining the local. |
| Class Variable | _astroid |
Undocumented |
| Class Variable | _other |
Undocumented |
Inherited from LocalsDictNodeNG (via ComprehensionScope):
| Method | __contains__ |
Check if a local is defined in this scope. |
| Method | __getitem__ |
The first node the defines the given local. |
| Method | __iter__ |
Iterate over the names of locals defined in this scoped node. |
| Method | add |
Append a child that should alter the locals of this scope node. |
| Method | items |
Get the names of the locals and the node that defines the local. |
| Method | keys |
The names of locals defined in this scoped node. |
| Method | qname |
Get the 'qualified' name of the node. |
| Method | scope |
The first parent node defining a new scope. |
| Method | set |
Define that the given name is declared in the given statement node. |
| Method | values |
The nodes that define the locals in this scoped node. |
| Method | _append |
append a child, linking it in the tree |
| Method | _scope |
XXX method for interfacing the scope lookup |
Inherited from LookupMixIn (via ComprehensionScope, LocalsDictNodeNG):
| Method | ilookup |
Lookup the inferred values of the given variable. |
| Method | lookup |
Lookup where the given variable is assigned. |
def __init__(self, lineno=None, col_offset=None, parent=None, *, end_lineno=None, end_col_offset=None):
(source)
¶
| Parameters | |
| lineno:int or None | The line that this node appears on in the source code. |
| col | The column that this node appears on in the source code. |
| parent:NodeNG or None | The parent node in the syntax tree. |
| end | The last line this node appears on in the source code. |
| end | The end column this node appears on in the source code. Note: This is after the last symbol. |
Determine the boolean value of this node.
| Returns | |
| Uninferable | The boolean value of this node.
For a SetComp this is always Uninferable. |
Do some setup after initialisation.
| Parameters | |
| elt:NodeNG or None | The element that forms the output of the expression. |
| generators:list(Comprehension) or None | The generators that are looped through. |