diff options
author | Chris Bieneman <beanz@apple.com> | 2016-10-03 04:48:13 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-10-03 04:48:13 +0000 |
commit | fc6e46a3141388d4ad394623bb58d1e30503ef69 (patch) | |
tree | 3c012b4d72f8ff4a996e1145c5a58cc8fc5da222 /llvm/utils/lit/tests | |
parent | c9786f0d8a4db5f11442962907da2a4999ce8ec3 (diff) | |
download | bcm5719-llvm-fc6e46a3141388d4ad394623bb58d1e30503ef69.tar.gz bcm5719-llvm-fc6e46a3141388d4ad394623bb58d1e30503ef69.zip |
[lit] Compare to None using identity, not equality
Summary:
In Python, `None` is a singleton, so checking whether a variable is
`None` may be done with `is` or `is not`. This has a slight advantage
over equiality comparisons `== None` and `!= None`, since `__eq__` may
be overridden in Python to produce sometimes unexpected results.
Using `is None` and `is not None` is also recommended practice in
https://www.python.org/dev/peps/pep-0008:
> Comparisons to singletons like `None` should always be done with `is` or
> `is not`, never the equality operators.
Patch by Brian Gesiak!
Reviewers: ddunbar, echristo, beanz
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D25168
llvm-svn: 283088
Diffstat (limited to 'llvm/utils/lit/tests')
0 files changed, 0 insertions, 0 deletions