Undocumented
Class |
|
Object for every result to `node.infer()` |
Class |
|
Merging of multiple inference result into one |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | base |
using use_def chain info to infer the value |
Function | cache |
Undocumented |
Function | calc |
return the result of comp_list and op_list, assuming comp_list[0] is left, and all value in comp_list is constant |
Function | const |
return nodes equivalent of const value. Will yield all combination of the content of the list |
Function | container |
Undocumented |
Function | convert |
Undocumented |
Function | extract |
Undocumented |
Function | extract |
Undocumented |
Function | extract |
Undocumented |
Function | extract |
Undocumented |
Function | extract |
Undocumented |
Function | extract |
Undocumented |
Function | getitem |
Undocumented |
Function | getitem |
Undocumented |
Function | infer |
inference entry point |
Function | infer |
Undocumented |
Function | infer |
infer variable that is being assigned (AssignName and AssignAttribute |
Function | infer |
Undocumented |
Function | infer |
E.g. a += 2 inferring this node will yield the value of `a` |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
- 'and' and 'or' evaluates expression from left to right. - with and, if all values are True, returns the last evaluated value. If any value is false, returns the first one. - or returns the first True value... |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Infer a name object that look at the global scope |
Function | infer |
running: 1 if x else 2 will yield 1, 2 |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
reference: https://docs.python.org/3/reference/datamodel.html#object.__bool__ First we'll try __bool__, if the method does not exist, we'll try __len__, and it's True if it return non zero. The instance is True when both of the method doesn't exist... |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Infer the latest KILL variable of the func that is called |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | infer |
try to get the instance from arg that passed in. E.g. def foo(a): return a.b.c This will create temp instance (i.e. UselessStub) for a.b When inferring the real value though, the real instance (a.b) is needed and can get from arguments that are passing in. |
Function | infer |
Undocumented |
Function | infer |
Undocumented |
Function | inference |
should return a transform function that change node._explicit_inference |
Function | limit |
Limit inference amount. Limit inference amount to help with performance issues with exponentially exploding possible results. :param iterator: the inference iterator :type iterator: Iterator(BaseNode) :param size: Maximum mount of nodes yielded plus an Uninferable at the end if limit reached :type size: int :yields: A possibly modified generator :rtype param: Iterable... |
Function | reverse |
Undocumented |
Constant | CONST |
Undocumented |
Constant | CONTAINER |
Undocumented |
Constant | MANAGER |
Undocumented |
Function | _bin |
To yield different combination of dunder method calling |
Function | _comp |
To yield different combination of dunder method calling In compare node, we don't care about the type since there is no reflected dunder method in comparison op. |
Function | _infer |
Undocumented |
Function | _infer |
Undocumented |
Function | _invoke |
find the dunder method and call _infer_binop |
Function | _make |
Undocumented |
Function | _make |
Undocumented |
return the result of comp_list and op_list, assuming comp_list[0] is left, and all value in comp_list is constant
@cache_yield_different
@decorators.inference_path
@MANAGER.infer_wrapper
def infer(self, context=context_mod.context_ins, inferred_attr=None): (source)
inference entry point
- 'and' and 'or' evaluates expression from left to right. - with and, if all values are True, returns the last evaluated value. If any value is false, returns the first one. - or returns the first True value. If all are False, returns the last value ALl the following elements are False: [/] = implemented, [x] = pending. [/] None [/] False [/] 0 (whatever type from integer, float to complex) [/] Empty collections: “”, (), [], {} [x] Objects from classes that have the special method __nonzero__ [x] Objects from classes that implements __len__ to return False or zero
Undocumented
def infer_formattedvalue(node, context=context_mod.context_ins, inferred_attr=None): (source)
Undocumented
Parameters | |
node:nodes.FormattedValue | Undocumented |
context | Undocumented |
inferred | Undocumented |
Undocumented
reference: https://docs.python.org/3/reference/datamodel.html#object.__bool__ First we'll try __bool__, if the method does not exist, we'll try __len__, and it's True if it return non zero. The instance is True when both of the method doesn't exist
Undocumented
def infer_joinedstr(node, context=context_mod.context_ins, inferred_attr=None): (source)
Undocumented
Parameters | |
node:nodes.JoinedStr | Undocumented |
context | Undocumented |
inferred | Undocumented |
try to get the instance from arg that passed in. E.g. def foo(a): return a.b.c This will create temp instance (i.e. UselessStub) for a.b When inferring the real value though, the real instance (a.b) is needed and can get from arguments that are passing in.
Limit inference amount. Limit inference amount to help with performance issues with exponentially exploding possible results. :param iterator: the inference iterator :type iterator: Iterator(BaseNode) :param size: Maximum mount of nodes yielded plus an Uninferable at the end if limit reached :type size: int :yields: A possibly modified generator :rtype param: Iterable
Undocumented
Value |
|
To yield different combination of dunder method calling
Parameters | |
left:InferenceResult | Undocumented |
right:InferenceResult | Undocumented |
op | Undocumented |
context | Undocumented |
To yield different combination of dunder method calling In compare node, we don't care about the type since there is no reflected dunder method in comparison op.
Parameters | |
left:InferenceResult | Undocumented |
right:InferenceResult | Undocumented |
op | Undocumented |
context | Undocumented |
Undocumented
Parameters | |
left:InferenceResult | Undocumented |
right:InferenceResult | Undocumented |
op | Undocumented |
context | Undocumented |
find the dunder method and call _infer_binop
Parameters | |
instance:InferenceResult | Undocumented |
method | Undocumented |
other:InferenceResult | Undocumented |
op | Undocumented |
infer | Undocumented |
context | Undocumented |
def _make_call_from_dunder_method(instance, dunder_method, context, *args): (source)
Undocumented