Skip to content

Improve lib2to3 future_features annotation - #16097

Merged
srittau merged 1 commit into
python:mainfrom
giri256:fix/lib2to3-future-features
Jul 29, 2026
Merged

Improve lib2to3 future_features annotation#16097
srittau merged 1 commit into
python:mainfrom
giri256:fix/lib2to3-future-features

Conversation

@giri256

@giri256 giri256 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Part of #14031.

RefactoringTool populates Node.future_features from _detect_future_features, which collects tokenizer NAME values and returns a frozenset. This narrows the placeholder element type from Incomplete to str and removes the unused import.

Validation:

  • focused tests/runtests.py stdlib/lib2to3: pre-commit, structure, strict Pyright, ty, mypy, and both regression suites passed
  • direct detector probe returned frozenset({'annotations', 'generator_stop'}) with str elements
  • global and module-specific stubtest failures reproduced identically on untouched origin/main; none reference future_features

Signed-off-by: Giridhar <80974392+giri256@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit 81c8a2d into python:main Jul 29, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants