-
-
Notifications
You must be signed in to change notification settings - Fork 294
Sum and multiply #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sum and multiply #740
Conversation
…ray and not [array, Uninferable] because it could lead to false negatives.
…er of times the node has been visited. The push method return True depending on a condition of the number of visits.
…rrors (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
Hey @hippo91 The code looks good. I tested this against |
…rrors (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
@PCManticore thanks for looking at this. I confirm that there is a problem with this unit test. I'm trying to fix it. |
i had a look at the
In case |
If a class inherits from two bases and the classes are expressed as a non-trivial expression such as qualified with a module name, classes after the first could not be inferred due to reusing the context object in _inferred_bases
Before this change, when there were import failures by Astroid, it would store the error in the module cache (for example a "module not found" error), including tracebacks. These tracebacks would take up a lot of memory, and don't seem to be used for any sort of purpose beyond debugging value. On one project stripping this value entirely reduces memory usage by 75%.
This fixes some `inconsistent-return-statement` pylint errors
… raising 'too many positional arguments'
Taking into account @GergelyKalmar suggestion Co-authored-by: Gergely Kalmár <[email protected]>
Taking into account @GergelyKalmar suggestion Co-authored-by: Gergely Kalmár <[email protected]>
Taking into account @GergelyKalmar suggestion Co-authored-by: Gergely Kalmár <[email protected]>
Taking into account @GergelyKalmar suggestion Co-authored-by: Gergely Kalmár <[email protected]>
Fix deprecated importlib methods
Bug pylint 3856
@hippo91 Yeah, that makes sense, let's add that in separate PRs. |
This fixes a false positive with the `assignment-from-no-return` pylint check. Close pylint-dev/pylint#3904
…thon 3.9 This is necessary for pylint to detect that `subprocess.Popen` is subscriptable, starting from Python 3.9 (see pylint-dev/pylint#4034). $ python3.9 >>> import subprocess >>> subprocess.Popen.__class_getitem__ <bound method GenericAlias of <class 'subprocess.Popen'>>
… (only with python3.9)
…_getitem brain: Add `__class_getitem__` to `subprocess.Popen` starting from Python 3.9
Bug pylint 4001
Replaced by |
Steps
Description
This PR tries to solve the issue #669. In fact the call to some functions of the
numpy
brains are inferred not only asnumpy.ndarray
but also asUninferable
. This lead to false negative for such function calls.The origin of this bug has been hard to find but seems to be due to the fact that the
context.push
method returnTrue
as soon as the node in argument has been visited once for the current context.However for some particular cases, such as those encountered in the
numpy
library, a node could be visited more than once due to peculiar imports.The modification made here ensure that all calls to
numpy ufunc
functions are inferred only asnumpy.ndarray
and modifies two inference unit tests. Those ones seem more pertinent but a close look from the reviewer would be appreciated.Type of Changes
Related Issue
Closes #669