Uh oh!
There was an error while loading. Please reload this page.
gh-133403: Add type annotations to generate_levenshtein_examples.py - #143317
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JelleZijlstra
left a comment
There was a problem hiding this comment.
I'm not sure we're OK with adding typing to arbitrary files. I'd prefer to get an approval from someone who works on this file.
ce4462f to
22a495dCompareAA-Turner
commented
Jan 1, 2026
I'd agree with Jelle, I also think we should weigh up churn cost for PRs in this category. This PR doesn't seem to be LLM generated at first glance, but I imagine this ('add type hints to X file') could be a magnet for such activity. A |
sandole
commented
Jan 1, 2026
sorry guys first time contributor here but would really like to be a regular contributor who's the go-to guy for these CI / tooling changes? |
picnixz
commented
Jan 1, 2026
That would be any of the maintainer working on traceback.py. The original author's @ambv, but considering we actually didn't change this file since 2022, I think we won't ever have a change to change it in the future either. Also, please avoid updating the branch if the CI is still green. It wastes CI resources as mentioned in https://devguide.python.org/getting-started/pull-request-lifecycle/#update-branch-button (more generally, please read the devguide). |
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as resolved.
vstinner
commented
Apr 7, 2026
cc @sobolevn |
sobolevn
commented
Apr 7, 2026
In my opinion, this is a really small PR that add pretty simple types. So, this is +1 from me :) |
Uh oh!
There was an error while loading. Please reload this page.
…s.py (pythonGH-143317) (cherry picked from commit 28b8d5f) Co-authored-by: John Seong <39040639+sandole@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sorry, @sandole and @hugovk, I could not cleanly backport this to |
GH-148734 is a backport of this pull request to the 3.14 branch. |
…s.py (python#143317) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Summary
Tools/build/generate_levenshtein_examples.pyTools/build/mypy.inito include the file for strict type checking.github/workflows/mypy.ymlto check the file in CIType annotations added
_substitution_cost,levenshtein, andmainexamplessetfrom __future__ import annotationsfor cleaner syntaxTest plan
mypy --config-file=Tools/build/mypy.ini Tools/build/generate_levenshtein_examples.pyThis continues the ongoing effort in #133403 to add type checking to more build tools.
📚 Documentation preview 📚: https://cpython-previews--143317.org.readthedocs.build/