Skip to content

Type Parameter Modernization - #202

Draft
FrancescoPezzella wants to merge 108 commits into
libcst-replace-frameworkfrom
typing-recipes-2
Draft

FrancescoPezzella wants to merge 108 commits into
libcst-replace-frameworkfrom
typing-recipes-2

Conversation

@FrancescoPezzella

@FrancescoPezzella FrancescoPezzella commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is about modernizing Type Parameters.

@FrancescoPezzella

FrancescoPezzella commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Goal of this new PR:

  • Rebase Typing Recipes with Python Scanner which is rebased with Main ( i need its changed ).

In this way, I have managed to get rid of all the unnecessary clutter in Git History and also follow the workflow I saw other PRs follow.

@FrancescoPezzella
FrancescoPezzella changed the base branch from main to python-scanner September 21, 2026 12:52
@FrancescoPezzella
FrancescoPezzella added this pull request to stack #203 September 21, 2026 12:52
@FrancescoPezzella

Copy link
Copy Markdown
Collaborator Author

I am gonna try out this whole stacked thing, so my changes dont get blocked by some feature I could use.

@FrancescoPezzella FrancescoPezzella self-assigned this Sep 21, 2026
@FrancescoPezzella FrancescoPezzella added the enhancement New feature or request label Sep 21, 2026
Base automatically changed from python-scanner to main September 23, 2026 11:42
@FrancescoPezzella
FrancescoPezzella force-pushed the typing-recipes-2 branch 3 times, most recently from eaeef61 to f5168f2 Compare September 30, 2026 11:56
@FrancescoPezzella FrancescoPezzella changed the title Typing recipes 2 Type Parameter Modernization Oct 2, 2026
@FrancescoPezzella

FrancescoPezzella commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Names such as Type Hints and Type Var were rejected, such as Type Hints being too broad and covering list[int] etc which other tools such as Ruff already do, while Type Var being imprecise and not covering all the changes made here such as ParamSpec.

I will from now on be referring to this as Type Parameter Modernization.

@FrancescoPezzella
FrancescoPezzella force-pushed the typing-recipes-2 branch 2 times, most recently from 1a6e17e to a7d45be Compare October 9, 2026 09:39
@FrancescoPezzella FrancescoPezzella linked an issue Oct 12, 2026 that may be closed by this pull request
5 tasks
@FrancescoPezzella
FrancescoPezzella removed this pull request from stack #203 October 12, 2026 13:27
@FrancescoPezzella
FrancescoPezzella changed the base branch from main to libcst-replace-framework October 12, 2026 13:27
@FrancescoPezzella
FrancescoPezzella added this pull request to stack #277 October 12, 2026 13:28
FrancescoPezzella added a commit that referenced this pull request Oct 12, 2026
Add a placeholder copyright header to the new files and give the PR's TODOs an author and issue link (#189, #269, #279, #280).
…clarations, that is just Step 3's job/ Generic is now fully ignored and not changed
…rameters. Type Vars can now be safely converted, even if the imports cannot be deleted (before it was all or nothing), now a partial fix is applied.
…CONFLICT`. Detect name conflicts in the file when localizing a Type Var with for example a bound=Box, where Box is already defined in the file.
…n Covariant/Contravariant/Bound is added to ParamSpec/TypeVarTuple, the change becomes unsafe since a modern syntax for it does not exist.
Fixes the conflicting-rewrite ValueError on `from x import T, U`; each needed import is added once.
…file

The origin's `from ._compat import TypeVar` is now rewritten relative to the importing file instead of losing its dots.
…tected after a numerous amount of checks).
…ze_import, moving its relative-import and alias cases to the localization tests. Documented a bug with comments being lost.
Add a placeholder copyright header to the new files and give the PR's TODOs an author and issue link (#189, #269, #279, #280).
@FrancescoPezzella
FrancescoPezzella force-pushed the typing-recipes-2 branch 2 times, most recently from d8c480f to 8ab7782 Compare October 13, 2026 08:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Type Parameters to Renaissance.Py

1 participant