| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
When inferring a property, we instantiate a new `objects.Property` object,
which in turn, because it inherits from `FunctionDef`, sets itself in the locals
of the wrapping frame. This means that everytime we infer a property, the locals
are mutated with a new instance of the property.
Using `context` with `path_wrapper` would not have helped, because we call `inferred()`
on functions in multiple places in pylint's codebase.
|
|
|
|
|
|
|
| |
`path_wrapper` needs to come first, followed by `raise_if_nothing_inferred`,
otherwise we won't handle `StopIteration` correctly.
Close #762
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
statement
In 19b5af02304e3339fdd2a26cfafc337960eeebce we added a check for `AugAssign` nodes
when inferring `Assign` values. Unfortunately the `infer_assign` function was also
used by `infer_assignname`, which meant that when trying to infer an `AssignName` node,
we were inferring its value as the result of the `AugAssign` inference, leading
to spurious false positives.
Close PyCQA/pylint#2911
Close PyCQA/pylint#3214
|
| |
|
| |
|
|
|
|
|
| |
These new capabilities will allow inferring both the `property` builtin
as well as property attributes such as `.deleter` and `.setter`.
|
|
|
|
|
|
|
|
|
| |
This should prevent a bunch of recursion errors happening in pylint.
Also refactor the inference of `IfExp` nodes to use separate contexts
for each potential branch.
Close PyCQA/pylint#3152
Close PyCQA/pylint#3159
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
While copying the path solves some inference issues, it also leads to
horrenduous performance hits on large libraries such as pandas.
We still want to have the path copying, but we need a better understanding
on why that is needed, as well as a change on how we operate with the inference
contexts.
|
|
|
|
| |
Fixes astroid bug #614.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Uninferable acts as None so that should be enough.
|
| |
|
| |
|
| |
|
|
|
|
| |
Close PyCQA/pylint#2526
|
|
|
|
|
|
|
|
|
|
|
| |
the call sites where it is used
infer_call_result started recently to raise InferenceError for objects for which it could not find any returns.
Previously it was silently raising a StopIteration, which was especially leaking when calling builtin methods.
Since it is after all an inference method, it is expected that it could raise an InferenceError rather than
returning nothing.
Close PyCQA/pylint#2350
|
|
|
|
| |
The explicit StopIterations were themselves were cut in ceeee097.
|
| |
|
|
|
|
| |
pylint doesn't understand decorators
|
|
|
|
|
|
|
| |
have any guards against them
This is especially important in a Python 3.7 worlds where we need to handle StopIteration
that can be triggered by next() over empty generators.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Add context_lookup to the context class as extra_context.
Deliver the correct context with the correct boundnode
for function argument nodes.
Close #177
|
|
|
|
|
| |
Code in multiple places had the same pattern
for infering call results.
|
| |
|
|
|
|
| |
which we'll never get to fix/change
|
|
|
|
|
|
|
| |
I tried this to see if it would improve performance. It didn't, but it
does look nicer, so we might as well keep it.
See also 5fd5aa81483e709cb5c464c7d4bb37c8c39f2afa
|
|
|
|
| |
Close PyCQA/pylint#2059
|
| |
|
| |
|
|
|
|
|
|
| |
Because we don't support Python 2 any longer in the master branch, we can
return values from generators to signal that we want to throw a StopIteration,
without actually raising the StopIteration itself.
|
| |
|
|
|
|
|
|
|
|
| |
This allows inference of function arguments to be different than the
inference of the function body
Currently this is only used for object.__new__(cls) calls but
can be expanded later
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The augmented assign rhs context path was deleted most likely
due to a recently fixed inference bug where InferenceContext path
attributes were shared between objects.
Recursive functions on the right hand side of the augmented assign would
forget that they were already called, causing an eventual RecursionError
in astroid inference
Now that the InferenceContext clone() method properly copies the
inference path between Contexts, it's fine to remove this hack.
Fixes #437, Fixes #447, Fixes #313, Fixes PyCQA/pylint#1642, Fixes PyCQA/pylint#1805, Fixes PyCQA/pylint#1854, Fixes PyCQA/pylint#1452
|
| |
|
|
|
|
| |
Close PyCQA/pylint#1619
|
|
|
|
| |
Similarly to _infer_binop, we have to handle exceptions raised by
helpers.is_subtype and helpers.is_supertype in _infer_augassign.
|
| |
|