Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a number of location there were comparisons against
None
, and boolean values that were using equality comparisons. This can lead to bugs caused by false positives. Bug of this nature are hard track down.While I could not track down an instance of the bug, this PR introduces the correct pattern of using identity comparisons to the code base. Hopefully, the pattern will be followed within future work, and no unexpected bugs arise.
Equality and Identity by example
In the repl equality and identity can easily be seen.
Classes defining a custom
__eq__()
methods can have logic error that allowingNone
equality to be true.More on comparisons can be found at https://docs.python.org/3/reference/expressions.html#comparisons
Verification
There is no fundamental change to the logic. All tests should pass as expected.
Note: Locally I was not setup to run e2e tests.