GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `ParamType` and other typing improvements by kdeldycke · Pull Request #3371 · pallets/click

Conversation

@kdeldycke

@kdeldycke kdeldycke commented Apr 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

PR to track and study the unmerged changes from @AndreasBackx that were left in the stale typing/paramtype. See the discussion at https://github.com/pallets/click/discussions/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:

  • BoolParamType: rewritten in Fix reconciliation of envvar with default, flag_value and type parameters for flag options #2956
  • Choice normalization: already part of Expand Choice token normalization + make generic #2796
  • File docstring: already cleaned up in Break up arguments section #2586

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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
@kdeldycke kdeldycke added the typing Type annotations and stubs label Apr 22, 2026
@kdeldycke
kdeldycke force-pushed the typing/paramtype branch from bbf4257 to ffe4a45 Compare April 22, 2026 17:00
@kdeldycke kdeldycke mentioned this pull request Apr 22, 2026
Extract _guess_type from convert_type and add overloads #3372
Merged
@AndreasBackx @kdeldycke
ParamType typing improvements
5989375
Co-authored-by: Kevin Deldycke <[email protected]>
@kdeldycke
kdeldycke force-pushed the typing/paramtype branch from ffe4a45 to 5989375 Compare April 22, 2026 17:28
@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
AndreasBackx
AndreasBackx approved these changes Apr 24, 2026
View reviewed changes

@AndreasBackx AndreasBackx left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably update the example in the docs as well: https://click.palletsprojects.com/en/stable/parameter-types/. Maybe also inline the version updates in the docs.

Approving as this is already an improvement and I don't see any regressions from popping up, besides perhaps the tuple type checking?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/click/core.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/click/types.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kdeldycke added a commit that referenced this pull request Apr 27, 2026
@kdeldycke
Narrow down type ignore
8e19856
Refs: #3371 (comment)
@AndreasBackx @kdeldycke
Narrow down type ignore
6e981ed
Refs: #3371 (comment)

Co-authored-by: Kevin Deldycke <[email protected]>
@kdeldycke
kdeldycke force-pushed the typing/paramtype branch from 8e19856 to 6e981ed Compare April 27, 2026 13:37
kdeldycke added 3 commits April 27, 2026 15:55
@kdeldycke
Eliminate one type ignore
3e2d92c
Refs #3371 (comment)
@kdeldycke
Make FuncParamType is generic
78a4efc
Refs: #3371 (comment)
@kdeldycke
Update examples in docs, adds version update admonitions
ded5b69
Refs: #3371 (review)
@kdeldycke

kdeldycke commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator Author

We should probably update the example in the docs as well: https://click.palletsprojects.com/en/stable/parameter-types/. Maybe also inline the version updates in the docs.

Just updated the docs at: ded5b69

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke

kdeldycke commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @AndreasBackx for reviewing your own code and the approval! 😎 Unless you find some quick win to add, I propose to consider this PR ready for final review/merge.

Again, the main objective here is to clear the backlog of PRs and close global branches like typing/paramtype.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke
kdeldycke requested review from Rowlando13 and davidism April 27, 2026 14:39
kdeldycke added a commit to kdeldycke/click that referenced this pull request Apr 27, 2026
@AndreasBackx @kdeldycke
Extract _guess_type from convert_type and add overloads
c314f96
This is a refactor that was original part of `typing/paramtype` branch but split out of pallets#3371 to keep the latter focused on typing only.

Co-authored-by: Kevin Deldycke <[email protected]>
@Rowlando13
Rowlando13 changed the base branch from stable to main April 29, 2026 06:30
@Rowlando13
Rowlando13 merged commit 8a2b489 into main Apr 29, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13
Rowlando13 deleted the typing/paramtype branch April 29, 2026 06:31
@kdeldycke

kdeldycke commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator Author

Any reason @Rowlando13 that you merged into main and not stable? Anyway, thanks for the merge and removal of typing/paramtype!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke kdeldycke mentioned this pull request Apr 29, 2026
Parameter typing improvements #2805
Merged
2 tasks done
kdeldycke added a commit to kdeldycke/click that referenced this pull request Apr 29, 2026
@AndreasBackx @kdeldycke
Extract _guess_type from convert_type and add overloads
b2bfd55
This is a refactor that was original part of `typing/paramtype` branch but split out of pallets#3371 to keep the latter focused on typing only.

Co-authored-by: Kevin Deldycke <[email protected]>
@kdeldycke kdeldycke mentioned this pull request Apr 30, 2026
Cleanup documentation for 8.4.0 #3393
Merged
@kdeldycke

kdeldycke commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

Any reason @Rowlando13 that you merged into main and not stable?

Just answered my question based on yesterday's activity: seems like we target main because we stated an 8.x release cycle (8.4.0 in this case), and it seems the tradition is to target stable for 8.3.x/8.4.x kind of releases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke kdeldycke mentioned this pull request Apr 30, 2026
FuncParamType should use ValueError message in self.fail() #3211
Merged
@Rowlando13

Rowlando13 commented Apr 30, 2026

Copy link
Copy Markdown
Member

Yep

kdeldycke reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@AndreasBackx AndreasBackx AndreasBackx approved these changes
@davidism davidism Awaiting requested review from davidism
@Rowlando13 Rowlando13 Awaiting requested review from Rowlando13

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

typing Type annotations and stubs

Projects

None yet

Milestone

8.4.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@kdeldycke @Rowlando13 @AndreasBackx
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.