PyCQA / pycodestyle

Simple Python style checker in one Python file

Home Page:https://pycodestyle.pycqa.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E721 false positive with method access

shadchin opened this issue · comments

Environment

% python -V
Python 3.11.3
% pycodestyle --version
2.11.0

% pip list
Package     Version
----------- -------
django-upgrade 1.14.0
flake8         6.1.0
mccabe         0.7.0
pip            23.2.1
pycodestyle    2.11.0
pyflakes       3.1.0
pyupgrade      3.9.0
setuptools     65.5.0
tokenize-rt    5.1.0

E721 false positive

% cat test.py
import foo


assert foo.type("foo") == "bar"
% pycodestyle test.py
test.py:4:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

suggested fix: #1228