This relates to #671
pip install --user pycodestyle
pycodestyle --version
2.4.0
E721 is the error for comparing the type(x) of something with another instead of using isinstance. Looking at #671, I thought this was something that I could submit a PR for. Looking at the testsuite for E72, however, this is expected behavior currently.
Any object named types is assumed to be the stdlib types module. There are many just reasons for a library to have a types module making selective disabling of E721 mandatory. (or alias imports).
from foo import types
some_value = get_column_from_db()
if some_value == types.MyThing.SOME_PROPERTY:
...
Submitting an issue instead of PR because I'm not sure what context can be available to checks. :) The goal of the project is to be quick so the ast is out of the question. With that, either:
types module checkingtypes@froody: is this fixed and deployed in a recent release?
@coxley no, the PR which mentioned this was closed without merge
Ah whoops, missed that. Thanks.
Ping ping ping. We run into so many false-positives with this. Considering disabling the lint globally in our setup, but it's a nice one to have.
@coxley please don't ping issues like that, I'd suggest attempting a patch