You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a patch which fixes following errors in comparison of ipaddress classes.
Ordering comparison raised AttributeError when compared with foreign classes.
Ordering comparison didn't return NotImplemented when compared with foreign classes. This prevented fallback to foreign class comparison method.
There was a bug in _TotalOrderingMixin.__le__(). It could return False instead of NotImplemented if compared network and address of different versions.
There was a typo in ComparisonTests.test_incompatible_versions().
As far as functools.total_ordering now is fixed and more correct and tested than _TotalOrderingMixin, _TotalOrderingMixin is dropped away.
That test for ordering and comparison interoperability is actually pretty neat - I wonder if we could make it more generally available as a "check my class handles NotImplemented correctly" check (in unittest?), which would potentially be useful in pursuing a fix for issue bpo-11477.
The fact the default __ne__ implementation doesn't handle NotImplemented correctly should probably be filed as a separate issue.
!=
to the right-hand side argument is not always doneNote: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: