Skip to content

disallowed-name check no longer checks non-constants #3701

Closed
@mattclay

Description

@mattclay

Commit 3422e4a changed the behavior of the invalid-name check, but also changed the behavior of blacklisted-name, which appears to be unintentional (and undocumented).

Steps to reproduce

demo.py:

foo = {}.keys()
foo = None

pylint demo.py -d all -e blacklisted-name

Current behavior

From pylint 2.5.0 and later:

demo.py:2:0: C0102: Black listed name "foo" (blacklisted-name)

Expected behavior

From pylint 2.4.4:

demo.py:1:0: C0102: Black listed name "foo" (blacklisted-name)
demo.py:2:0: C0102: Black listed name "foo" (blacklisted-name)

pylint --version output

pylint 2.5.0
astroid 2.4.2
Python 3.7.4 (default, Oct 16 2019, 10:35:50)
[Clang 11.0.0 (clang-1100.0.33.8)]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions