KEMBAR78
Remove force_uppercase_builtins default from test helpers by cdce8p · Pull Request #19173 · python/mypy · GitHub
Skip to content

Conversation

@cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented May 30, 2025

Mypy only supports Python 3.9+. Update the tests to use lowercase names for PEP 585 generics in error messages. A followup can consider deprecating --force-uppercase-builtins and making it a no-op.

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.

Nice! I have one question.

if m := re.search(r"python3([0-9]+)\.test$", path):
# For older unsupported version like python38,
# default to that earliest supported version.
return max((3, int(m.group(1))), defaults.PYTHON3_VERSION)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this use PYTHON3_VERSION_MIN?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tbh I wasn't sure myself. PYTHON3_VERSION_MIN makes sense, but in that case we should also use it as the default for all other test cases as well, not just those with -python3X. Pushed dcde1aa to adjust it.

@cdce8p cdce8p force-pushed the tests-remove-force-uppercase-builtins branch from 0b70f03 to dcde1aa Compare May 30, 2025 10:44
@JukkaL JukkaL merged commit 409d294 into python:master May 30, 2025
13 checks passed
@cdce8p cdce8p deleted the tests-remove-force-uppercase-builtins branch May 30, 2025 14:31
@cdce8p cdce8p added the topic-pep-585 PEP 585 (builtin generics) label May 30, 2025
cdce8p added a commit to cdce8p/mypy that referenced this pull request May 31, 2025
Mypy only supports Python 3.9+. Update the tests to use lowercase names
for PEP 585 generics in error messages. A followup can consider
deprecating `--force-uppercase-builtins` and making it a no-op.
JukkaL pushed a commit that referenced this pull request Jun 5, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-pep-585 PEP 585 (builtin generics) topic-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants