| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
pair (ndarray, Uninferable)
|
| | |
|
| | |
|
| |
|
|
| |
No need to mock the sum function. Just inform the engine that the out parameter in the sum function is an array.
|
| | |
|
| |
|
|
| |
is an astroid.Name instance
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
| |
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.
|
| | |
|
| |
|
|
| |
behavior of ufunc numpy objects
|
| | |
|
| |
|
|
|
| |
These new capabilities will allow inferring both the `property` builtin
as well as property attributes such as `.deleter` and `.setter`.
|
| |
|
|
|
| |
Ignoring all special methods while inspecting gi classes leads to pylint
not detecting that objects are e.g. iterable or subscriptable
|
| | |
|
| |
|
|
|
|
|
|
| |
It is possible for a module to use comments that might be interpreted
as type comments by the `ast` library. We do not want to completely crash on those
invalid type comments.
Close #708
|
| |
|
| |
When profiling locally, approximately 7% of a full pylint run is spent in `os.getcwd`, despite its value effectively not being used if `context_file` is `None`. A quick grep over this project and others seem to indicate that `context_file` is rarely used, so this should almost entirely get rid of this system call.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Close #722
|
| |
|
|
| |
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
|
| |
|
|
|
|
|
|
| |
This monkeypatches several changes from [PyCQA/mccabe](https://github.com/PyCQA/mccabe/blob/master/setup.py)
over to the pylint repo, since the pattern was equivalent between
the two projects.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
* Sort imports.
* Remove squelching of W0704, since recent versions of pylint do not support
the warning, resulting in an error with `pylint -E`.
* Add `pylint: disable=unused-import` to seemingly unused imports which
actually affect build behavior.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a very tricky bug and requires particular circumstances to reproduce.
For `f.__get__` we have a custom binding interface that generates bound
methods on the fly whenever we encounter an `f.__get__(None, ...)` call.
On function creation, we set the name of the function as a variable in
the frame of the function's parent. e.g. for the following, we'll set
`variable` as a name in the function's locals:
class A:
...
def variable(self): # variable will be part of A.locals
pass
Now the bug that this commit solves requires a `__get__()` binding such
as the one mentioned as well as passing an object's dunder attribute
to `__get__`, such as `object.__eq__`. The result is that the `None`
that was passed in `f.__get__` will have as a frame the function where
the descriptor binding method was called, which will result in `__eq__`
to be marked as a variable of the function that was called, which is
completely wrong.
As a solution we don't set any parent for descriptor bound methods,
which are created on the fly and thus the parent might be wrong altogether.
Close PyCQA/pylint#3225
|
| |
|
|
| |
Fixes: #716
|
| |
|
|
| |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
|