-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Improve error messages for super
checks and add more tests
#16393
Conversation
This comment has been minimized.
This comment has been minimized.
test-data/unit/check-super.test
Outdated
@staticmethod | ||
def st() -> int: | ||
reveal_type(super(B, B).st()) # N: Revealed type is "builtins.int" | ||
super().st() # E: "super" requires one or more positional arguments in enclosing function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here again, it's specifically the zero-argument form of super()
that we're complaining about (the reveal_type()
call in the line immediately above this one works fine for the two-argument form of super()
). So I'd keep the ()
here as well, personally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it should be "one or two" not "one or more" 👍
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Now all messages use the same
"super"
formatting, it used to be a bit different.