Skip to content

Fix python 'testing equality to none' issue#5

Open
luzpaz wants to merge 1 commit intoceanwang:masterfrom
luzpaz:testing-equality-to-none
Open

Fix python 'testing equality to none' issue#5
luzpaz wants to merge 1 commit intoceanwang:masterfrom
luzpaz:testing-equality-to-none

Conversation

@luzpaz
Copy link

@luzpaz luzpaz commented Apr 1, 2022

"When you compare an object to None, use is rather than ==. None is a singleton object, comparing using == invokes the eq method on the object in question, which may be slower than identity comparison. Comparing to None using the is operator is also easier for other programmers to read."

"When you compare an object to None, use is rather than ==. None is a singleton object, comparing using == invokes the __eq__ method on the object in question, which may be slower than identity comparison. Comparing to None using the is operator is also easier for other programmers to read."
@luzpaz
Copy link
Author

luzpaz commented Apr 11, 2022

@ceanwang ping

1 similar comment
@luzpaz
Copy link
Author

luzpaz commented Aug 1, 2022

@ceanwang ping

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.

1 participant

Comments