It is recommended to use identity test ( is ) instead of equality test ( == ) when you need to compare types of two objects.
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.
replaced iterating the dictionary directly instead of calling .keys(). Using for key in dictionary would always iterate the dictionary keys.
remove unused imported modules.
Submissions guide:
[X] Have you followed the Contribution guidelines?
[X] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
[X] Have you made corresponding changes to the documentation?
[X] Your submission doesn't break any existing feature.
[X] Have you lint your code locally prior to submission?
What is the change? What does it fix/add?
This PR includes:
using
is
instead of==
Comparisons to the singleton objects, like
True
,False
, andNone
, should be done with identity, not equality. Use “is” or “is not”. Identity checks are faster than equality checks.replaced iterating the dictionary directly instead of calling
.keys()
. Usingfor key in dictionary
would always iterate the dictionary keys.remove unused imported modules.
Submissions guide: