Skip to content

Bump mypy to 1.8.0 #113385

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

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Bump mypy to 1.8.0 #113385

merged 1 commit into from
Dec 21, 2023

Conversation

AlexWaygood
Copy link
Member

The new mypy version flags a minor typing error in clinic.py:

Tools\clinic\clinic.py:5933: error: Subclass of "Sentinels" and "bool" cannot exist: "bool" is final  [unreachable]
                        if isinstance(value, (bool, NoneType)):
                                      ^~~~~
Tools\clinic\clinic.py:5933: error: Subclass of "Sentinels" and "NoneType" cannot exist: "NoneType" is final  [unreachable]
                        if isinstance(value, (bool, NoneType)):
                                      ^~~~~
Tools\clinic\clinic.py:5933: error: Subclass of "Null" and "bool" cannot exist: "bool" is final  [unreachable]
                        if isinstance(value, (bool, NoneType)):
                                      ^~~~~
Tools\clinic\clinic.py:5933: error: Subclass of "Null" and "NoneType" cannot exist: "NoneType" is final  [unreachable]
                        if isinstance(value, (bool, NoneType)):
                                      ^~~~~
Tools\clinic\clinic.py:5934: error: Statement is unreachable  [unreachable]
                            c_default = "Py_" + py_default
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The issue is that our current annotation for value is incorrect; it should have a much broader type, since it could potentially be anything returned from a call to eval() on line 5927

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@AlexWaygood AlexWaygood enabled auto-merge (squash) December 21, 2023 23:02
@AlexWaygood AlexWaygood merged commit 7de9855 into python:main Dec 21, 2023
@AlexWaygood AlexWaygood deleted the bump-mypy branch December 21, 2023 23:14
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull request Dec 26, 2023
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants