| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
Close PyCQA/pylint#3648
|
| |
|
|
|
|
|
|
| |
`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#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
|
| | |
|
| |
|
|
| |
decorator across the codebase
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
`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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
| |
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/
|
| |
|
|
|
| |
These new capabilities will allow inferring both the `property` builtin
as well as property attributes such as `.deleter` and `.setter`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
classes
When inferring instances of classes from arguments, such as ``self``
in a bound method, we could use as a hint the context's ``boundnode``,
which indicates the instance from which the inference originated.
As an example, a subclass that uses a parent's method which returns
``self``, will override the ``self`` to point to it instead of pointing
to the parent class.
Close PyCQA/pylint#3157
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
We were able to infer exception instances as ``ExceptionInstance``
only for a handful of cases, but not all. ``ExceptionInstance`` has
support for better inference of `.args` and other exception related
attributes that normal instances do not have.
This additional support should remove certain false positives related
to ``.args`` and other exception attributes in ``pylint``.
Close PyCQA/pylint#2333
|
| |
|
|
|
|
|
|
|
|
| |
Certain stdlib modules use ``*args`` to encapsulate
the ``self`` parameter, which results in uninferable
instances given we rely on the presence of the ``self``
argument to figure out the instance where we should be
setting attributes.
Close PyCQA/pylint#3216
|
| | |
|
| |
|