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

Use == instead of "is" for equality testing #431

Merged
merged 1 commit into from Mar 28, 2023
Merged

Use == instead of "is" for equality testing #431

merged 1 commit into from Mar 28, 2023

Conversation

naglis
Copy link
Contributor

@naglis naglis commented Sep 11, 2020

Identity check (is, is not) with certain literals (e.g. strings, numbers) is not guaranteed by the language specification to work and issue a warning starting with Python 3.8, e.g.:

examples/browse.py:326: SyntaxWarning: "is" with a literal. Did you mean "=="?

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

Identity check (`is`, `is not`) with certain literals (e.g. strings,
numbers) is not guaranteed by the language specification to work and
issue a warning starting with Python 3.8, e.g.:

> examples/browse.py:326: SyntaxWarning: "is" with a literal. Did you mean "=="?
@coveralls
Copy link

Coverage Status

Coverage remained the same at 77.868% when pulling f52544f on naglis:fix-syntax-warning into a5f27ba on urwid:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 77.868% when pulling f52544f on naglis:fix-syntax-warning into a5f27ba on urwid:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 77.868% when pulling f52544f on naglis:fix-syntax-warning into a5f27ba on urwid:master.

Copy link
Collaborator

@ulidtko ulidtko left a comment

Choose a reason for hiding this comment

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

LGTM

@penguinolog penguinolog merged commit 3ce6429 into urwid:master Mar 28, 2023
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.

None yet

4 participants