-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix the length of platform.uname_result #13068
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
Conversation
It should be a 6-tuple, once processor is added. This makes sure mypy understands that. Fixes python#13064
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This seems to work as expected. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
srittau
left a comment
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.
Wow, what a hacky (upstream) class ... I wonder whether it's a better idea to just use the else branch for both versions, considering that the hacks are probably meant to emulate a six-field namedtuple. This means that the special-casing of namedtuple in type checkers could work better. Although we probably need to override __init__ in that case ...
In any case, I think we should add test cases for this.
|
I couldn't figure out a way to re-create the exact failure from the daily test in the regression test. Is there any way to do a regression test stub right now? Is that something that might be useful for other cases as well? The regression test shows that mypy accepts the |
This comment has been minimized.
This comment has been minimized.
|
I opened a discussion topic for the difference between mypy and pyright in this case: https://discuss.python.org/t/conflicting-tuple-base-classes/72038 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
I don't like how many ignores this needs. But it does satisfy both mypy and pyright, and should fix the daily test failure. |
This comment has been minimized.
This comment has been minimized.
|
Why do we need the |
|
It's not adding much at this point. Here's a version without it. |
JelleZijlstra
left a comment
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.
Thanks, this version seems cleaner
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
This solution gets |
|
Thanks @tungol! |
It should be a 6-tuple, once processor is added. This makes sure mypy understands that.
Fixes #13064