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

Remove the 'rop will not be called' error message #5571

Conversation

Michael0x2a
Copy link
Collaborator

#5475 introduced a new type of error message ("rop will not be called when evaluating 'a + b'...") that triggers when the user tries evaluating expressions like foo + foo where foo does not contain an __add__ method that accepts a value of the same type, but does contain an __radd__ method that does.

This pull request removes that error message on the grounds that it's too cryptic and unlikely to be helpful to most mypy users. That error message is useful mainly for people developing libraries containing custom numeric types (or libraries that appropriate operators to create custom DSLs) -- however, most people are not library creators and so will not find this error message useful.

python#5475 introduced a new type of error
message ("__rop__ will not be called when evaluating 'a + b'...") that
triggers when the user tries evaluating expressions like `foo + foo`
where `foo` does not contain an `__add__` method that accepts a value
of the same type, but *does* contain an `__radd__` method that does.

This pull request removes that error message on the grounds that it's
too cryptic and unlikely to be helpful to most mypy users. That error
message is useful mainly for people developing libraries containing
custom numeric types (or libraries that appropriate operators to create
custom DSLs) -- however, most people are not library creators and so
will not find this error message useful.
@Michael0x2a Michael0x2a mentioned this pull request Sep 4, 2018
12 tasks
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I was thinking maybe we can keep this error if it appears for classes defined in user code, but t hen it is very hard to decide what is user code, so probably just removing the note is a right solution.

Anyway, most likely the code flagged with error will fail at runtime.

@ilevkivskyi ilevkivskyi merged commit bdad88a into python:master Sep 5, 2018
@Michael0x2a Michael0x2a deleted the remove-rop-will-not-be-called-error-message branch December 16, 2018 22:20
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

Successfully merging this pull request may close these issues.

2 participants