class Lambda(mixins.FilterStmtsMixin, LocalsDictNodeNG): (source)
Known subclasses: astroid.nodes.scoped_nodes.FunctionDef
Class representing an ast.Lambda
node.
>>> import astroid >>> node = astroid.extract_node('lambda arg: arg + 1') >>> node <Lambda.<lambda> l.1 at 0x7f23b2e41518>
Method | __init__ |
|
Method | argnames |
Get the names of each of the arguments. |
Method | bool_value |
Determine the boolean value of this node. |
Method | callable |
Whether this node defines something that is callable. |
Method | display_type |
A human readable type of this node. |
Method | frame |
The node's frame node. |
Method | get_children |
Undocumented |
Method | implicit_parameters |
Undocumented |
Method | infer_call_result |
Infer what the function returns when called. |
Method | postinit |
Do some setup after initialisation. |
Method | pytype |
Get the name of the type that this node represents. |
Method | scope_lookup |
Lookup where the given names is assigned. |
Class Variable | is_lambda |
Undocumented |
Class Variable | name |
Undocumented |
Instance Variable | args |
The arguments that the function takes. |
Instance Variable | body |
The contents of the function body. |
Instance Variable | locals |
A map of the name of a local variable to the node defining it. |
Property | type |
Whether this is a method or function. |
Class Variable | _astroid_fields |
Undocumented |
Class Variable | _other_other_fields |
Undocumented |
Inherited from FilterStmtsMixin
:
Method | assign_type |
Undocumented |
Method | _get_filtered_stmts |
method used in _filter_stmts to get statements and trigger break |
Inherited from LocalsDictNodeNG
:
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_local_node |
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_local |
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_node |
append a child, linking it in the tree |
Method | _scope_lookup |
XXX method for interfacing the scope lookup |
Inherited from LookupMixIn
(via LocalsDictNodeNG
):
Method | ilookup |
Lookup the inferred values of the given variable. |
Method | lookup |
Lookup where the given variable is assigned. |
astroid.nodes.scoped_nodes.FunctionDef
Parameters | |
lineno:int or None | The line that this node appears on in the source code. |
col_offset:int or None | The column that this node appears on in the source code. |
parent:NodeNG or None | The parent node in the syntax tree. |
end_lineno:Optional[int] | The last line this node appears on in the source code. |
end_col_offset:Optional[int] | The end column this node appears on in the source code. Note: This is after the last symbol. |
astroid.nodes.scoped_nodes.FunctionDef
Returns | |
bool | The boolean value of this node.
For a Lambda this is always True. |
Returns | |
bool | True if this defines something that is callable,
False otherwise.
For a Lambda this is always True. |
astroid.nodes.scoped_nodes.FunctionDef
The node's frame node.
A frame node is a Module
, FunctionDef
,
ClassDef
or Lambda
.
Parameters | |
future:Literal[ | Undocumented |
Returns | |
T | The node itself. |
astroid.nodes.scoped_nodes.FunctionDef
Parameters | |
caller:object | Unused |
context | Undocumented |
astroid.nodes.scoped_nodes.FunctionDef
Parameters | |
args:Arguments | The arguments that the function takes. |
body:list(NodeNG) | The contents of the function body. |
astroid.nodes.scoped_nodes.FunctionDef
Parameters | |
node:NodeNG | The node to look for assignments up to. Any assignments after the given node are ignored. |
name:str | The name to find assignments for. |
offset:int | The line offset to filter statements up to. |
Returns | |
tuple(str, list(NodeNG)) | This scope node and the list of assignments associated to the given name according to the scope where it has been found (locals, globals or builtin). |
astroid.nodes.scoped_nodes.FunctionDef
astroid.nodes.scoped_nodes.FunctionDef
astroid.nodes.scoped_nodes.FunctionDef
Returns | |
'method' if this is a method, 'function' otherwise. |