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
The default implementation of __ne__ just defers to __eq__, so x != y should be False. It seems that Struct has its own __ne__ implementation that does not do this.
Admittedly, this is a really weird case that would probably be solved by making y a private field (#199). I'd also be happy with just updating the docs to state that if you provide a custom __eq__ that you should also define __ne__.
Thanks for the excellent reproducible issue, this has been fixed in #593.
Admittedly, this is a really weird case that would probably be solved by making y a private field (#199).
As part of that work I also intend to support field level configuration for eq/repr/init, matching the behavior of dataclasses and attrs. When that's done, you should be able to do something like this to get what you want:
Activity
jcrist commentedon Nov 25, 2023
Thanks for the excellent reproducible issue, this has been fixed in #593.
As part of that work I also intend to support field level configuration for
eq/repr/init, matching the behavior of dataclasses and attrs. When that's done, you should be able to do something like this to get what you want:Solumin commentedon Nov 25, 2023
Thank you for fixing this so quickly!
Excellent, I think that will be a very helpful feature.