Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E714: fix chained is not #931

Merged
merged 2 commits into from
May 8, 2020

Conversation

suzil
Copy link

@suzil suzil commented May 1, 2020

Closes #767

@suzil suzil changed the title E714: fix changed is not E714: fix changed is not May 1, 2020
@suzil suzil changed the title E714: fix changed is not E714: fix chained is not May 1, 2020
@suzil suzil force-pushed the fix/767/chained-is-not-E714 branch from f817513 to 5230110 Compare May 1, 2020 13:42
@@ -64,6 +64,9 @@
#: E714
if not X.B is Y:
pass
#: E714
if not X is Y is not Z:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit silly but does this still trigger E714 (I think it should, even though it's absurd)?

if not X is not Y:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I've adjusted the regex and added it as a test case.

So it will now catch the pattern not X is/in like before except when it's preceded by the keyword is.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E714 miscategorizes chained 'is not'
3 participants