-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
Fix Symbol.__eq__
to return false when comparing with None
#1481
Conversation
No, the class should not just silently return In what context are you encountering this error message? What are you trying to do? |
So, technically a client could encounter the Symbol class thru the I'm encountering this not thru that API, but because I had to get pretty deep into the internals of the reconstruction process, and reimplemented both the Has the assert used here helped catch a bug before? I opened #1476 in the first place because I figured that overrides of |
Aha, yeah, that is clearly public API, even if experimental. We could either change the API to only use
If your changes are usable outside of your specific grammar, contributing them back would most likely be much appreciated - the |
I'm okay with returning |
OK, I updated this PR to return
@MegaIng - if I get some more bandwidth soon maybe I'll make a PR. The gist of the limitation I encountered was this: the
I think the most general way to allow this type of customization would be to allow the users to provide their own |
No, you should be returning |
Ah, TIL. Thank you for the correction. See latest commit. |
Thanks for contributing! |
Fixes #1476.
Symbol.__eq__
now returns False when comparing with an object that is not an instance of the Symbol class.