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 --- testsuite/E72.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'testsuite/E72.py') diff --git a/testsuite/E72.py b/testsuite/E72.py index e789d82..bba55f5 100644 --- a/testsuite/E72.py +++ b/testsuite/E72.py @@ -4,7 +4,7 @@ if type(res) == type(42): #: E721 if type(res) != type(""): pass -#: E721 +#: Okay import types if res == types.IntType: @@ -47,8 +47,6 @@ if isinstance(res, str): pass if isinstance(res, types.MethodType): pass -if type(a) != type(b) or type(a) == type(ccc): - pass #: Okay def func_histype(a, b, c): pass -- cgit v1.2.1