pycodestyle
pycodestyle copied to clipboard
E721: suggest reasonable alternative
E721 is there to prevent type(3) == int in favour of isinstance(3, int). Thats fine.
But it also raises an error for code like type(a) == type(b). This is good code though and I don't know of a better way to test if two values have the same type. Of course you can go for isinstance(a, type(b)), but that is longer and less readable.
I suggest either changing E721 to not match lines like the above or to suggest a reasonable alternative to the line above.