Handle NotImplemented correctly in ErrorDetail.__ne__#8538
Handle NotImplemented correctly in ErrorDetail.__ne__#8538lovelydinosaur merged 1 commit intoencode:masterfrom allanlewis:7433-handle-not-implemented-for-ErrorDetail-__ne__
NotImplemented correctly in ErrorDetail.__ne__#8538Conversation
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? |
lovelydinosaur
left a comment
There was a problem hiding this comment.
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