-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Handle NotImplemented
correctly in ErrorDetail.__ne__
#8538
Handle NotImplemented
correctly in ErrorDetail.__ne__
#8538
Conversation
PR #7531 resolved issue #7433 by updating `ErrorDetails.__eq__` to correctly handle the `NotImplemented` case. However, Python 3.9 continues to issue the following warning: DeprecationWarning: NotImplemented should not be used in a boolean context This is because `__ne__` still doesn't handle the `NotImplemented` case correctly. In order to avoid this warning, this commit makes the same change for `__ne__` as previously made for `__eq__`.
Wait. Haven't we got both of these wrong? In what context is What code is returning it? |
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.
Test - does this unapprove?
You need to "dismiss review" from the panel at the bottom.
No, we've got this right, see the docs:
|
Gotcha, thanks. |
As I said in #7433 (comment) I'm happy to add a test for this case, given some guidance. |
Perhaps we're okay with it not having one. |
Please rename „r” to „result” or something else. |
@wieczorek1990 The change here is consistent with the existing code above. |
Thanks, @tomchristie 🙏 |
I don’t think short names are good code. |
Generally agreed. |
@tomchristie Here: #8585 |
…encode#8538) PR encode#7531 resolved issue encode#7433 by updating `ErrorDetails.__eq__` to correctly handle the `NotImplemented` case. However, Python 3.9 continues to issue the following warning: DeprecationWarning: NotImplemented should not be used in a boolean context This is because `__ne__` still doesn't handle the `NotImplemented` case correctly. In order to avoid this warning, this commit makes the same change for `__ne__` as previously made for `__eq__`.
As per the sole commit:
refs #7433 #7531