this module contains a set of functions to handle python protocols for nodes where it makes sense.
| Function | arguments |
Undocumented |
| Function | assend |
Undocumented |
| Function | assign |
Undocumented |
| Function | assign |
Undocumented |
| Function | const |
Undocumented |
| Function | excepthandler |
Undocumented |
| Function | for |
Undocumented |
| Function | instance |
Undocumented |
| Function | match |
Infer MatchAs as the Match subject if it's the only MatchCase pattern else raise StopIteration to yield Uninferable. |
| Function | match |
Return empty generator (return -> raises StopIteration) so inferred value is Uninferable. |
| Function | match |
Return empty generator (return -> raises StopIteration) so inferred value is Uninferable. |
| Function | named |
Infer names and other nodes from an assignment expression |
| Function | sequence |
Undocumented |
| Function | starred |
self: nodes.Starred node: a node related to the current underlying Node. context: Inference context used for caching already inferred objects assign_path: |
| Function | tl |
Undocumented |
| Function | with |
Infer names and other nodes from a with statement. |
| Constant | AUGMENTED |
Undocumented |
| Constant | BIN |
Undocumented |
| Constant | BIN |
Undocumented |
| Constant | REFLECTED |
Undocumented |
| Constant | UNARY |
Undocumented |
| Variable | objects |
Undocumented |
| Variable | raw |
Undocumented |
| Function | _arguments |
Undocumented |
| Function | _augmented |
Undocumented |
| Function | _filter |
Undocumented |
| Function | _infer |
Undocumented |
| Function | _infer |
Undocumented |
| Function | _multiply |
Undocumented |
| Function | _reflected |
Undocumented |
| Function | _resolve |
recursive function to resolve multiple assignments |
| Function | _resolve |
recursive function to resolve multiple assignments on loops |
| Constant | _CONTEXTLIB |
Undocumented |
| Constant | _UNARY |
Undocumented |
nodes.Arguments, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
nodes.AssignName | nodes.AssignAttr, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
nodes.AnnAssign, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
def assign_assigned_stmts(self:
nodes.AugAssign | nodes.Assign | nodes.AnnAssign, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
def const_infer_binary_op(self, opnode, operator, other, context, _): (source) ¶
Undocumented
def excepthandler_assigned_stmts(self:
nodes.ExceptHandler, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
def for_assigned_stmts(self:
nodes.For | nodes.Comprehension, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
def instance_class_infer_binary_op(self, opnode, operator, other, context, method): (source) ¶
Undocumented
def match_as_assigned_stmts(self:
nodes.MatchAs, node: nodes.AssignName, context: InferenceContext | None = None, assign_path: Literal[ None] = None) -> Generator[ nodes.NodeNG, None, None]:
(source)
¶
Infer MatchAs as the Match subject if it's the only MatchCase pattern else raise StopIteration to yield Uninferable.
def match_mapping_assigned_stmts(self:
nodes.MatchMapping, node: nodes.AssignName, context: InferenceContext | None = None, assign_path: Literal[ None] = None) -> Generator[ nodes.NodeNG, None, None]:
(source)
¶
Return empty generator (return -> raises StopIteration) so inferred value is Uninferable.
def match_star_assigned_stmts(self:
nodes.MatchStar, node: nodes.AssignName, context: InferenceContext | None = None, assign_path: Literal[ None] = None) -> Generator[ nodes.NodeNG, None, None]:
(source)
¶
Return empty generator (return -> raises StopIteration) so inferred value is Uninferable.
def named_expr_assigned_stmts(self:
nodes.NamedExpr, node: node_classes.AssignedStmtsPossibleNode, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Infer names and other nodes from an assignment expression
nodes.Tuple | nodes.List, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Undocumented
def starred_assigned_stmts(self:
nodes.Starred, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
- Arguments:
self: nodes.Starred node: a node related to the current underlying Node. context: Inference context used for caching already inferred objects assign_path:
A list of indices, where each index specifies what item to fetch from the inference results.
def tl_infer_binary_op(self, opnode, operator, other, context, method): (source) ¶
Undocumented
def with_assigned_stmts(self:
nodes.With, node: node_classes.AssignedStmtsPossibleNode = None, context: InferenceContext | None = None, assign_path: list[ int] | None = None) -> Any:
(source)
¶
Infer names and other nodes from a with statement.
This enables only inference for name binding in a with statement.
For instance, in the following code, inferring func will return
the ContextManager class, not whatever __enter__ returns.
We are doing this intentionally, because we consider that the context
manager result is whatever __enter__ returns and what it is binded
using the as keyword.
- class ContextManager(object):
- def __enter__(self):
- return 42
- with ContextManager() as f:
- pass
# ContextManager().infer() will return ContextManager # f.infer() will return 42.
- Arguments:
self: nodes.With node: The target of the assignment,
as (a, b)inwith foo as (a, b). context: Inference context used for caching already inferred objects assign_path:A list of indices, where each index specifies what item to fetch from the inference results.
Undocumented
| Value |
|
Undocumented
| Value |
|