Pylint: __class__ as unused variable

Created on 18 Dec 2017  路  5Comments  路  Source: PyCQA/pylint

Steps to reproduce

  1. Install pylint 1.7.1 and astroid 1.6.0
  2. run pylint on module with a class defined, but not instantiated

Current behavior

Any where a class is defined it's being called an unused variable.

************* Module repo_release.update_changes_file
W: 14, 0: Unused variable '__class__' (unused-variable)
W: 14, 0: Unused variable '__class__' (unused-variable)
W: 14, 0: Unused variable '__class__' (unused-variable)
W: 14, 0: Unused variable '__class__' (unused-variable)
W: 14, 0: Unused variable '__class__' (unused-variable)
W: 14, 0: Unused variable '__class__' (unused-variable)
************* Module repo_release.release_utils
W: 10, 0: Unused variable '__class__' (unused-variable)
************* Module repo_release.do_release
W: 26, 0: Unused variable '__class__' (unused-variable)
W: 26, 0: Unused variable '__class__' (unused-variable)

Expected behavior

Should not be a warning

pylint --version output

pylint 1.7.1,
astroid 1.6.0
Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)]

Most helpful comment

Sorry @memsharded That was supposed to be pylint 1.8 or 1.7.5 with astroid 1.5.3

All 5 comments

Should note that it works with astroid 1.5.3 as a workaround.

In my case I am observing this same behavior, but I would like to add that it is only happening in Py3.6, but NOT in Py2.7. Reproduced in Win, Linux and OSX too.

You'll need astroid 1.8 or 1.7.5 with 1.5.3 for this to go away.

Hi @PCManticore
But astroid 1.8 is still not there? https://github.com/PyCQA/astroid/releases

Even in https://pypi.python.org/pypi/astroid, the latest one is 1.6. So this is still an open issue, right? It is not fixed yet, it will happen, there is not known workaround. Shouldn't it be kept open, and closed when Astroid 1.8 is out? Or am I missing something?

Thanks very much for your help!

Sorry @memsharded That was supposed to be pylint 1.8 or 1.7.5 with astroid 1.5.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glmdgrielson picture glmdgrielson  路  3Comments

pylint-bot picture pylint-bot  路  3Comments

GergelyKalmar picture GergelyKalmar  路  3Comments

PCManticore picture PCManticore  路  3Comments

adamtheturtle picture adamtheturtle  路  3Comments