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 identity operator is when comparing to None #45120

Merged
merged 1 commit into from
Oct 10, 2017
Merged

Use identity operator is when comparing to None #45120

merged 1 commit into from
Oct 10, 2017

Conversation

johnthagen
Copy link
Contributor

This is very minor, but idiomatic Python code uses is for comparisons to None. This is because semantically we want to compare to the "identity" of None, not its value.

See PEP8 for details.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@sfackler
Copy link
Member

sfackler commented Oct 8, 2017

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 8, 2017

📌 Commit d9e6703 has been approved by sfackler

@carols10cents carols10cents added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 9, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Oct 9, 2017
…ackler

Use identity operator `is` when comparing to None

This is very minor, but idiomatic Python code uses `is` for comparisons to `None`. This is because semantically we want to compare to the "identity" of `None`, not its value.

See [PEP8 for details](https://www.python.org/dev/peps/pep-0008/#programming-recommendations).
bors added a commit that referenced this pull request Oct 10, 2017
Rollup of 9 pull requests

- Successful merges: #44962, #45051, #45091, #45106, #45117, #45118, #45120, #45125, #45136
- Failed merges:
@bors bors merged commit d9e6703 into rust-lang:master Oct 10, 2017
@johnthagen johnthagen deleted the none-identity-test branch October 10, 2017 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants