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

Improve error messages for super checks and add more tests #16393

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 2, 2023

Now all messages use the same "super" formatting, it used to be a bit different.

This comment has been minimized.

@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
Copy link
Member

@AlexWaygood AlexWaygood Nov 3, 2023

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

Copy link
Member Author

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.

Copy link
Contributor

github-actions bot commented Nov 3, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@sobolevn sobolevn merged commit 93e6de4 into master Nov 3, 2023
18 checks passed
@sobolevn sobolevn deleted the issue-16391 branch November 3, 2023 09:01
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.

4 participants