Skip to content

Improve lib2to3 future_features annotation - #16097

Open
giri256 wants to merge 1 commit into
python:mainfrom
giri256:fix/lib2to3-future-features
Open

Improve lib2to3 future_features annotation#16097
giri256 wants to merge 1 commit into
python:mainfrom
giri256:fix/lib2to3-future-features

Conversation

@giri256

@giri256 giri256 commented Jul 27, 2026

Copy link
Copy Markdown

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. 🤖🎉

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.

1 participant