Comparisons to the singleton objects, like True, False, and None, should be done with identity, not equality. Use is or is not.
Identity checks are faster than equality checks.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
Checklist:
[x] My code follows the style guidelines(Clean Code) of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have created a helpful and easy to understand README.md
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests/screenshots(if any) that prove my fix is effective or that my feature works
Co-authored-by: deepsource-autofix[bot] 62050782+deepsource-autofix[bot]@users.noreply.github.com
Description
Comparisons to the singleton objects, like
True
,False
, andNone
, should be done with identity, not equality. Useis
oris not
. Identity checks are faster than equality checks.Type of change
Checklist:
README.md