Skip to content

Regression in astroid-2.4: False positive not-callable error #775

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

Closed
hiranya911 opened this issue Apr 28, 2020 · 1 comment
Closed

Regression in astroid-2.4: False positive not-callable error #775

hiranya911 opened this issue Apr 28, 2020 · 1 comment
Labels
Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine

Comments

@hiranya911
Copy link

hiranya911 commented Apr 28, 2020

We are using Pylint 2.3.1. Until today following class linted without issues:

class PageIterator:
    def __init__(self, current_page):
        # Removed for clarity

    def next(self):
        # Removed for clarity

    def __next__(self):
        return self.next()

    def __iter__(self):
        return self

Today since astroid-2.4.0 was released, our CI workflows are failing with the following error:

E1102: self.next is not callable (not-callable)

Line number points to the return self.next() in the above class. This seems to be a regression as this used to work fine, and self.next() is clearly a callable member method of the class.

Note that we are still using the same version of Pylint as before (it is hardcoded into our build scripts). But Astroid version is not controlled, and hence the CI workflow seems to pick the latest available.

@PCManticore
Copy link
Contributor

Thanks for the report. Unfortunately I cannot reproduce it using the released version. Here's what I'm getting:

a.py:1:0: C0114: Missing module docstring (missing-module-docstring)
a.py:1:0: C0115: Missing class docstring (missing-class-docstring)
a.py:5:4: C0116: Missing function or method docstring (missing-function-docstring)

I tried with pylint 2.4.4 and astroid 2.4.0 as well and got the same output.

Also you should probably either downgrade astroid or upgrade pylint to 2.5.0, since this astroid release might be incompatible with the previous pylint version.

If you happen to reproduce this on your side, please reopen the issue with more details.

@PCManticore PCManticore added the Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine label Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine
Projects
None yet
Development

No branches or pull requests

2 participants