Skip to content
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

do not raise but return NotImplemented on __add__ and __mul__ #37

Open
matiasg opened this issue Aug 21, 2021 · 0 comments
Open

do not raise but return NotImplemented on __add__ and __mul__ #37

matiasg opened this issue Aug 21, 2021 · 0 comments
Assignees

Comments

@matiasg
Copy link
Collaborator

matiasg commented Aug 21, 2021

methods __add__ and __mul__ should

return NotImplemented

whenever there's no known answer. This is the expected behaviour, stated in
https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types

If one of those methods does not support the operation with the supplied arguments, it should return NotImplemented.

@matiasg matiasg self-assigned this Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant