Skip to content

Astroid Infinite loop when __len__(self) is mistakenly defined as return len(self) #777

@simonepri

Description

@simonepri

Steps to reproduce

Lint the following program with pylint

class Crash:
    def __len__(self) -> int:
        return len(self)

Current behavior

The following error is thrown and pylint crashes

RecursionError: maximum recursion depth exceeded

Expected behavior

It should not crash.

Asteroid version

2.4.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions