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

chore: clean up a little typing #1291

Merged
merged 2 commits into from
Oct 4, 2022
Merged

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Oct 3, 2022

I was working on my lectures for this week (which are over static typing), and remembered we can clean this up. It doesn't even need a typing extensions bump; 4.1 is sufficient.

Signed-off-by: Henry Schreiner <[email protected]>
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

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

assert_never was indeed the best bet for that function name!

@joerick
Copy link
Contributor

joerick commented Oct 3, 2022

My goodness our tests are flaky at the moment. It's the pip error again.

@henryiii
Copy link
Contributor Author

henryiii commented Oct 3, 2022

Haha, yes. :) Currently running into a bug with pylint that it understands -> NoReturn, but not -> Never. IMO, the signature should have been Never) -> NoReturn, but it's not, and PyLint should understand that they are the same. It does in a few places, but not here. Not a failing check, but would be nice to fix.

Signed-off-by: Henry Schreiner <[email protected]>
Comment on lines 116 to 118
@staticmethod
# pylint: disable-next=inconsistent-return-statements
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> set[Architecture]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a really ugly place to put this lint disable comment. :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should (hopefully) be temporary.

@henryiii henryiii merged commit 35f2b8d into pypa:main Oct 4, 2022
@henryiii henryiii deleted the henryiii/chore/typing branch June 6, 2024 15:19
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