KEMBAR78
Deprecated --force-uppercase-builtins flag by cdce8p · Pull Request #19176 · python/mypy · GitHub
Skip to content

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented May 30, 2025

Use lowercase builtins for error messages, Mypy only supports 3.9+. This PR deprecates the --force-uppercase-builtins flag and makes it a no-op. Followup to #19173.

@cdce8p cdce8p added topic-pep-585 PEP 585 (builtin generics) topic-configuration Configuration files and flags labels May 30, 2025
@github-actions

This comment has been minimized.

@cdce8p cdce8p requested a review from sobolevn May 30, 2025 16:06
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

I like this! Thanks! I will have to adapt a lot of tests, but this should be done at some point anyway.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Left a few comments, otherwise looks good.

"options.use_lowercase_names() is deprecated and will be removed in a future version",
DeprecationWarning,
stacklevel=2,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm we don't use the warnings module much since mypy is usually used on the command line. This seems a bit inconsistent with existing behavior, so maybe this should reverted. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure about it. I've removed all calls to this method from the mypy codebase itself. So we could even think about just removing it completely. My intention with the DeprecationWarning was to help plugin developers which might be using it. Then again, I don't know if any plugins actually use it.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

django-stubs (https://github.com/typeddjango/django-stubs)
+ Warning: --force-uppercase-builtins is deprecated; mypy only supports Python 3.9+

@JukkaL JukkaL merged commit 9ded5b1 into python:master Jun 5, 2025
20 checks passed
@cdce8p cdce8p deleted the deprecate-force-uppercase-builtins branch June 5, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-configuration Configuration files and flags topic-pep-585 PEP 585 (builtin generics)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants