Skip to content

Commit 5c036dc

Browse files
committed
Check for 'is' and 'in' as well
1 parent 7e10d9a commit 5c036dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pycodestyle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
120120
WS_NEEDED_OPERATORS = frozenset([
121121
'**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>',
122122
'%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=',
123-
'and', 'or'] +
123+
'and', 'in', 'is', 'or'] +
124124
FUNCTION_RETURN_ANNOTATION_OP)
125125
WHITESPACE = frozenset(' \t')
126126
NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])

testsuite/E22.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
i = 1and 1
8181
#: E225
8282
i = 1or 0
83+
#: E225
84+
1is 1
85+
#: E225
86+
1in []
8387
#: E225 E226
8488
i=i+1
8589
#: E225 E226

0 commit comments

Comments
 (0)