Skip to content

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

@hiranya911

Description

@hiranya911

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs reproduction 🔍Need a way to reproduce it locally on a maintainer's machine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions