Skip to content

Commit

Permalink
Rollup merge of rust-lang#45120 - johnthagen:none-identity-test, r=sf…
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
kennytm committed Oct 9, 2017
2 parents 380b795 + d9e6703 commit d7f1a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def get_toml(self, key):
If the key does not exists, the result is None:
>>> rb.get_toml("key3") == None
>>> rb.get_toml("key3") is None
True
"""
for line in self.config_toml.splitlines():
Expand Down

0 comments on commit d7f1a26

Please # to comment.