Skip to content

ParamType and other typing improvements#3371

Open
kdeldycke wants to merge 1 commit intostablefrom
typing/paramtype
Open

ParamType and other typing improvements#3371
kdeldycke wants to merge 1 commit intostablefrom
typing/paramtype

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented Apr 22, 2026

WIP PR to track and study the unmerged changes from @AndreasBackx that were left in the stale typing/paramtype. See the discussion at #3329 for context.

I was able to salvage and rebase on top of stable the majority of the initial changes like:

  • making ParamType a generic ABC and introducing ParamTypeInfoDict
  • adding ParamTypeInfoDict
  • updating FuncParamType to a generic
  • narrowing of convert() return types
  • CompositeParamType generic with abstract arity

Stuff that were made obsolete from PRs merged upstream since the last commit in 2024:

Other stuff that I skipped as too strict:

  • _compat.py t.Any to t.AnyStr
  • File generic with t.AnyStr
  • _is_file_like with t.AnyStr

I also extracted from the original typing/paramtype the refactor of convert_type which is not strictly related to typing improvements and live in its own PR for later evaluation at: #3372

Related to #2805

@kdeldycke kdeldycke marked this pull request as draft April 22, 2026 16:23
@kdeldycke kdeldycke changed the base branch from main to stable April 22, 2026 16:23
Co-authored-by: Kevin Deldycke <kevin@deldycke.com>
@kdeldycke kdeldycke marked this pull request as ready for review April 22, 2026 17:29
@kdeldycke kdeldycke added this to the 8.4.0 milestone Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants