Core of the inference engine.
Function | get |
Get local attributes definitions matching the name from this frame node. |
Function | get |
Undocumented |
Function | infer |
Get a generator of the inferred values. See ASTNode.infer . |
Function | infer |
Infer the possible values of the given variable. |
Function | safe |
Return the inferred value for the given node. |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _infer |
Redirects to the right method to infer a node. Equivalent to ast astroid's NodeNG._infer() method. |
Function | _infer |
Undocumented |
Function | _infer |
From astroid's inference.infer_assign() function. |
Function | _infer_ |
Undocumented |
Function | _infer_ |
Inference logic for augmented binary operations. |
Function | _infer_ |
Binary operation inference logic. |
Function | _infer |
Inference's end for nodes that yield themselves on inference |
Function | _infer_ |
Support IfExp inference |
Function | _infer_ |
Undocumented |
Function | _infer |
Infers the left hand side in augmented binary operations. |
Function | _infer |
Infer a Name: use name lookup rules. |
Function | _infer_ |
Undocumented |
Function | _infer |
Undocumented |
Function | _infer |
Infer all values based on elts. |
Function | _infer |
Return an iterator on statements inferred by each statement in stmts. |
Function | _invoke |
Infer a binary operation between a left operand and a right operand. |
Function | _is |
Undocumented |
Function | _raise |
we don't know how to resolve a statement by default |
Constant | _AUGMENTED |
Undocumented |
Constant | _OPPERATORS |
Undocumented |
Variable | _globals |
Undocumented |
Get local attributes definitions matching the name from this frame node.
Parameters | |
ctx:_typing.FrameNodeT | Undocumented |
name:str | Undocumented |
ignorebool | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
List[ | Undocumented |
Undocumented
Parameters | |
pack:_typing.Module | Undocumented |
name:str | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
Optional[ | Undocumented |
Get a generator of the inferred values. See ASTNode.infer
.
This is kinda the main entry point to the inference system.
Parameters | |
context:OptionalInferenceContext | Undocumented |
Returns | |
iterable | The inferred values. |
Infer the possible values of the given variable.
Parameters | |
ctx:ASTNodeT | Undocumented |
name:str | The name of the variable to infer. |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | The inferred possible values. |
Return the inferred value for the given node.
Return None if inference failed, it's Uninfereable or if there is some ambiguity (more than one node has been inferred).
Parameters | |
node:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
Optional[ | Undocumented |
Redirects to the right method to infer a node. Equivalent to ast astroid's NodeNG._infer() method.
Parameters | |
node:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
From astroid's inference.infer_assign() function.
Parameters | |
node:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Undocumented
Parameters | |
node:_typing.Attribute | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Inference logic for augmented binary operations.
Parameters | |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Binary operation inference logic.
Parameters | |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Note | |
From astroid's inference._infer_binop() function. |
Inference's end for nodes that yield themselves on inference
These are objects for which inference does not have any semantic, such as Module or Constants.
Parameters | |
node:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Support IfExp inference
If we can't infer the truthiness of the condition, we default to inferring both branches. Otherwise, we infer either branch depending on the condition.
Parameters | |
node:_typing.IfExp | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Infers the left hand side in augmented binary operations.
@note: It only supports ast.Name instances at the moment.
Parameters | |
node:ast.expr | Undocumented |
context:InferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Infer a Name: use name lookup rules.
Parameters | |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Undocumented
Parameters | |
node:_typing.Name | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Undocumented
Parameters | |
context:OptionalInferenceContext | Undocumented |
assignbool | Undocumented |
Returns | |
InferResult | Undocumented |
Infer all values based on elts.
If infer_all_elements is False, will only infer Starred and NamedExpr inside the list, this is used for tuple assignments.
Parameters | |
node:Union[ | Undocumented |
context:OptionalInferenceContext | Undocumented |
inferbool | Undocumented |
Returns | |
List[ | Undocumented |
Return an iterator on statements inferred by each statement in stmts.
Parameters | |
stmts:List[ | Undocumented |
context:InferenceContext | Undocumented |
frame:Optional[ | Undocumented |
Returns | |
InferResult | Undocumented |
Infer a binary operation between a left operand and a right operand.
This is used by both normal binary operations and augmented binary operations.
Parameters | |
left:ASTNodeT | Undocumented |
opnode:Union[ | Undocumented |
op:ast.operator | Undocumented |
right:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Note | |
left and right are inferred nodes. |
we don't know how to resolve a statement by default
Parameters | |
node:ASTNodeT | Undocumented |
context:OptionalInferenceContext | Undocumented |
Returns | |
InferResult | Undocumented |
Undocumented
Value |
|