Skip to content

Commit

Permalink
Merge pull request #1228 from da-raf/e721-false-positive-member
Browse files Browse the repository at this point in the history
prevent false positive for E721 on member function
  • Loading branch information
asottile authored Feb 6, 2024
2 parents 37fac06 + 2a612c1 commit 7c0c613
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
r'(in|is)\s')
COMPARE_TYPE_REGEX = re.compile(
r'[=!]=\s+type(?:\s*\(\s*([^)]*[^\s)])\s*\))'
r'|\btype(?:\s*\(\s*([^)]*[^\s)])\s*\))\s+[=!]='
r'|(?<!\.)\btype(?:\s*\(\s*([^)]*[^\s)])\s*\))\s+[=!]='
)
KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS))
OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+|:=)(\s*)')
Expand Down
2 changes: 2 additions & 0 deletions testing/data/E72.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
if type(res) != type(""):
pass
#: Okay
res.type("") == ""
#: Okay
import types

if res == types.IntType:
Expand Down

0 comments on commit 7c0c613

Please sign in to comment.