Skip to content

Missed detection of undefined variable inside class #1555

Closed
@sdfgeoff

Description

@sdfgeoff

Steps to reproduce

Run pylint on the following:

class SomeClass():
    '''This class does nothing'''
    def __init__(self):
        self.val = self.val

Current behavior

No errors are thrown

Expected behavior

It should warn that self.val is undefined.
Note that it works correctly inside functions and at module level.

pylint --version output

pylint 1.7.1,
astroid 1.5.3
Python 3.6.1 (default, Mar 27 2017, 00:27:06)
[GCC 6.3.1 20170306]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions