-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
SyntaxWarning: "is not" with a literal. Did you mean "!="? #248
Comments
The warning comes from a later test: self.assertEqual(__, None is not 0)
self.assertEqual(__, None is not False) This is the old python2 syntax and with python3 it should be
However the
|
Hey @minusf Is there a way to work around that? For example adding |
i think the fix in #256 is fine... |
I would leave It's okay for some of these to produce Flake8 warnings, they're introducing concepts, and aren't necessarily something you would use in production code. I would remove the runtime -self.assertEqual(__, None is not 0)
-self.assertEqual(__, None is not False)
+self.assertEqual(__, None != False)
+self.assertEqual(__, None != 0) Please see PR #277 for this. |
That's true, but I was just wondering if we could do the ignore thing if we absolutely wanted no errors at all. The best thing would probably be just using != or even a try/except block to try both the versions. |
I'm trying to run
My python version is 3.9.5 on Ubuntu 21.04
The text was updated successfully, but these errors were encountered: