Skip to content

Delayed attribute assignment to object() may cause incorrect inference of instance attributes #945

Closed
@nelfin

Description

@nelfin

@cdce8p: aiohttp and VLCTelnet turned out to be red herrings. This case fails on current stable versions:

class Example:
    def prev(self):
        pass
    def next(self):
        pass
    def other(self):
        pass


ex = Example()
ex.other()  # no warning
ex.prev()   # no warning
ex.next()   # no warning

import typing

ex.other()  # no warning
ex.prev()   # false-positive: not-callable
ex.next()   # false-positive: not-callable

Originally posted by @nelfin in #927 (comment)

I've bisected this down to 78d5537. Pylint 2.3.1 passes this case with 20a7ae5 and fails with 78d5537

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions