-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dict
: fix the __eq__
implementation to call super
#5159
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5159 +/- ##
===========================================
+ Coverage 80.92% 80.93% +0.01%
===========================================
Files 536 536
Lines 37054 37054
===========================================
+ Hits 29984 29985 +1
+ Misses 7070 7069 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The `__eq__` method was recently implemented for the `Dict` data type but it erroneously did not call through to the super implementation in case the dictionary content does not match that of `other`. This caused the fallback equality implemented on the `Node` base class, which ensures that two nodes with the same UUID compare equal, to be missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a weird "Fix" because it doesn't really matter what you fall back to as long as it is guaranteed to be False
(you could even do return False
directly), right? This is just a logical impossibility because if the other node is not a Dict
then it will not be equal to this Dict
.
So, yeah, I mean, we can go ahead and merge I just found it a bit quirky 😅
I think you may have misread. The first conditional checks that |
Indeed, haha. Sorry, I was trying to get quick review before something else I had to do I should have read more carefully! |
Fixes the mistake merged in #5142 and this supersedes #5150
The
__eq__
method was recently implemented for theDict
data typebut it erroneously did not call through to the super implementation in
case the dictionary content does not match that of
other
. This causedthe fallback equality implemented on the
Node
base class, whichensures that two nodes with the same UUID compare equal, to be missed.