| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Close PyCQA/pylint#3686
|
|
|
| |
Close PyCQA/pylint#3648
|
|
|
|
| |
Close PyCQA/pylint#3519
|
|
|
|
|
|
|
|
| |
`Super.getattr()` (#782)
``infer_call_result`` can raise InferenceError but we were not handling that when retrieving
objects from the Super instance.
Close PyCQA/pylint#3529
|
|
|
|
| |
Close PyCQA/pylint#3549
|
| |
|
| |
|
|
|
|
| |
Close PyCQA/pylint#2335
|
|
|
|
|
|
|
|
|
|
| |
attributes
Modifying an attribute of a function with an augmented assignment resulted in
`FunctionDef.getattr` to prioritize the instance attributes fetching. This means
that only the augmented assignment modification would have been visible.
Close PyCQA/pylint#1078
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 2aa27e9aed6ffcba4a61655e291e852ecd001549 `ClassDef.igetattr`
was modified to only grab the first item from the result of `getattr`,
in order to avoid looking up attributes in the ancestors path when
inferring attributes for a given class. This had the side effect
that we'd omit attribute definitions happening in the same scope,
such as augmented assignments, which in turn might have affected
other capabilities, such as slots inference.
This commit changes the approach a bit and keeps all attributes
as long as all of them are from the same class (be it current
or an ancestor)
Close PyCQA/pylint#2334
|
|
|
|
| |
Close #425
|
| |
|
|
|
| |
Close #725
|
| |
|
|
|
|
| |
decorator across the codebase
|
| |
|
|
|
|
|
| |
Rather than failing the inference altogether, we can infer the default
int value for subclasses of ints.
|
|
|
|
|
|
|
|
|
| |
The recursion error was caused by inferring the bases of the generated
`B` class multiple times. The solution uses the new `EvaluatedObject`
class to stop the inference by inferring the base classes in the
`type` inference function.
Close #199
|
|
|
|
|
|
|
|
|
| |
This container is used to store values that have already been evaluated.
For instance, 79d5a3a783cf0b5a729e4e467508e955a0cca55f added support
for inferring `tuple()` call arguments, but as a result, the `elts` of a `Tuple`
can be objects not *references*. As a result, `Tuple.elts` can contain class objects
rather than references (names) to class object. The `EvaluatedObject` helps with that,
as we still have to call `.infer()` (albeit a no-op) to grab the inferred value of an element.
|
|
|
|
|
|
| |
a class
Close #749
|
|
|
|
|
|
| |
class itself
Close PyCQA/pylint#3032
|
|
|
|
|
|
|
|
|
|
|
| |
If `Module.getattr` received an empty string (as a result of inference for example),
`astroid` would have returned the same Module again, which leads to false positives
in pylint, since the expected output was of a different type.
Rather than allowing empty names to pass through `getattr()`, we simply raise
an error earlier.
Close PyCQA/pylint#2991
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
definition
Close PyCQA/pylint#1285
|
|
|
|
|
|
|
| |
`path_wrapper` needs to come first, followed by `raise_if_nothing_inferred`,
otherwise we won't handle `StopIteration` correctly.
Close #762
|
|
|
|
| |
installing it
|
|
|
|
|
| |
`object` cannot be inferred as an ancestor of datetime.date on PyPy, due to
a base class that is not inferrable.
|
|
|
|
| |
Close PyCQA/pylint#3209
|
|
|
|
| |
Close PyCQA/pylint#3414
|
|
|
| |
Close PyCQA/pylint#3417
|
|
|
|
|
|
|
| |
This fixes PyCQA/pylint#3332. The bug was due to the fact that datetime64 class
inherited from generic one and in this last class the astype method was returning
uninferable. Now it returns ndarray object.
This fix should be generalized to all other methods of the generic class as the numpy doc specifies that the generic object API should be the same as the ndarray one.
|
|
|
|
| |
Closes PyCQA/pylint#3365
|
|
|
| |
Close PyCQA/pylint#3322
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
The bug PyCQA/pylint#3319 was caused due to a missing function, named float_power inside the brain_numpy_core_umath module. This brain is used to infer all the numpy's ufunc functions. The problem is that in the website documentation of numpy, in the section that list all those functions, there is not entry dealing with the float_power function.
Also adds 5 missing functions detected by @texadactyl
Closes PyCQA/pylint#3319
|
|
|
| |
Closes PyCQA/pylint#3208
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of now, the transformation of builtin containers which
members, in turn, are containers relies on `safe_infer`
helper. `safe_infer` tries to infer the node to get its
values. Doing this without a cache containing a previously
inferred nodes lead to infinite recursion, for example, on
resolving a class attribute.
Note: this doesn't help to infer a class attribute by itself
is such a case, but prevents crash.
Closes: https://github.com/PyCQA/pylint/issues/3245
Signed-off-by: Stanislav Levin <slev@altlinux.org>
|
|
|
|
| |
Close PyCQA/pylint#3296
|
|
|
|
|
|
|
| |
Because ``Const.itered`` was not returning proper nodes, pylint was failing
when trying to infer objects created from those nodes.
Close PyCQA/pylint#3306
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes https://github.com/PyCQA/pylint/issues/3274.
Prior to Python 3.7, StopIteration errors bubbled up through generators,
so this wasn't an issue for astroid because the StopIteration error was
handled later. Now StopIteration errors are converted to RuntimeErrors
[1],
so the same error handling doesn't work.
[1]: https://www.python.org/dev/peps/pep-0479/
|
| |
|
|
|
|
| |
uninferable.
|
| |
|
| |
|
|
|
|
|
| |
ufunc functions are now instances of FakeUfunc class and that the call
to these functions implies the use of __call__ protocol.
|
| |
|
|
|
|
|
| |
These new capabilities will allow inferring both the `property` builtin
as well as property attributes such as `.deleter` and `.setter`.
|
| |
|