FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve error messages for `super` checks and add more tests by sobolevn · Pull Request #16393 · python/mypy · GitHub

Repository navigation

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

Merged
sobolevn merged 4 commits into
masterfrom
issue-16391
Nov 3, 2023
Merged

sobolevn merged 4 commits into
masterfrom
issue-16391

Conversation

sobolevn commented Nov 2, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

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

sobolevn requested a review from hauntsaninja November 2, 2023 10:32

This comment has been minimized.

Comment thread test-data/unit/check-super.test Outdated
Comment thread 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

AlexWaygood Nov 3, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And it should be "one or two" not "one or more" 👍

This comment has been minimized.

github-actions Bot commented Nov 3, 2023

Copy link
Copy Markdown
Contributor

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

sobolevn merged commit 93e6de4 into master Nov 3, 2023
sobolevn deleted the issue-16391 branch November 3, 2023 09:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL