From dcedb98f17514cc3174313fd0f009d460fa7babb Mon Sep 17 00:00:00 2001 From: Pavel Savchenko Date: Sun, 12 Dec 2021 09:24:39 +0000 Subject: Correct test assertions for E721 * `type(a) is type(b)` should still fail * same for `type(a) != type(b) or type(a) == type(ccc)` * We cannot assume `res == types.IntType` is wrong as the identity of the objects is not known at check time, either way it shouldn't be a E721 as it doesn't involve type(...) function as described in PEP8 --- pycodestyle.py | 1 - 1 file changed, 1 deletion(-) (limited to 'pycodestyle.py') diff --git a/pycodestyle.py b/pycodestyle.py index c1ec98d..c71071e 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -1465,7 +1465,6 @@ def comparison_type(logical_line, noqa): common base class, basestring, so you can do: Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): """ match = COMPARE_TYPE_REGEX.search(logical_line) if match and not noqa: -- cgit v1.2.1