| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Close #715
|
| |
|
|
| |
Close PyCQA/pylint#3212
|
| |
|
|
|
|
|
|
| |
as_string currently has very poor support for f-strings:
Conversions (e.g. !r) and format specifiers (e.g. :.3) are left out.
Quotes easily clash leading to syntax errors.
Escape sequences such as \n are not handled.
Literal braces are not escaped.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* Failing test for ClassDef.as_string involving keyword arguments
* Fix construction of keyword arguments in ClassDef as_string
|
| |
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Until now they had as parent the builtin `ast` node which meant
we were operating with primitive objects instead of our own.
Close PyCQA/pylint#3174
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
| |
Based on patch proposed by akai10tsuki on PyCQA/pylint#2585
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This should address various `dataclasses` issues that were surfaced
even more after the release of pylint 2.4.0.
In the previous versions of `astroid`, annotated assign nodes were
allowed to be retrieved via `getattr()` but that no longer happens
with the latest `astroid` release, as those attribute are not actual
attributes, but rather virtual ones, thus an operation such as `getattr()`
does not make sense for them.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Close PyCQA/pylint#2950
|
| | |
|
| | |
|
| |
|
|
| |
Close #689
|
| |
|
|
|
|
|
|
| |
We had two "copyrighted" files in the repo but they were containing
a basic class with a simple `__init__` method, so there's no need
to keep that around.
Close #685
|
| |
|
|
|
|
| |
The NodeNG.nearest method was not working properly as outlined in #691
and seem to not be in use at all across astroid and pylint.
Close #691
|
| | |
|