-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
specially crafted __rpow__ signature causes mypy to terminate with an "Internal Error" #5419
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
Comments
Just to double-check -- is this an issue with Your title uses the former but your post uses the latter. |
For a file containing just: def __rpow__(self, x: int, mod: int = ...) -> int: ... I get the following output in mypy HEAD:
If class Foo:
def __rpow__(self, x: int, mod: int = ...) -> int: ... |
srittau
added a commit
to srittau/mypy
that referenced
this issue
Aug 5, 2018
srittau
added a commit
to srittau/mypy
that referenced
this issue
Aug 5, 2018
Previously, functions that had the same name as a reversible dunder method (for example, __rpow__) were checked as if they were such a method. This could lead to crashes and false positives. Closes: python#5419
Thanks! I'm on vacation for the next 3 weeks, hopefully one of the other
mypy devs can review it.
…On Sun, Aug 5, 2018 at 8:07 AM, Sebastian Rittau ***@***.***> wrote:
So it seems we saw two different bugs here: If __rpow__ was part of a
class, it crashed. This was fixed in #5348
<#5348>. If __rpow__ was a
module-level function, it caused a different crash, which I try to fix in
#5421 <#5421>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5419 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMvcQMkgi9RgXFjnwWrD6PUIcn_mJks5uNwo7gaJpZM4VvRIc>
.
--
--Guido van Rossum (python.org/~guido)
|
Michael0x2a
pushed a commit
that referenced
this issue
Aug 5, 2018
Previously, functions that had the same name as a reversible dunder method (for example, __rpow__) were checked as if they were such a method. This could lead to crashes and false positives. Closes #5419
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally posted as Typeshed issue python/typeshed#2358
I discovered this bug mainly because I didn't know how
__repr__
was supposed to work.This line (even if it's the only line in the python file):
produces this output:
these very similar but slightly different lines will cause various warnings but will not cause the above problem:
The text was updated successfully, but these errors were encountered: