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 — `Parameter` typing improvements by AndreasBackx · Pull Request #2805 · pallets/click

Conversation

@AndreasBackx

@AndreasBackx AndreasBackx commented Nov 9, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

This removes all of the type: ignore mentions in Argument, its subclasses, and the exceptions module. To do so, the following is done:

  1. Parameter is now an abstract base class. This just clarifies it cannot be instantiated which was always the point.
  2. Parameter.name can no longer be None. It only ever is None when expose_value = False. Instead of having to deal with None and is None everywhere, let's just use "" instead of None when expose_value is False
  3. ctx in Parameter.get_error_hint can be None. It always has been like this, but wasn't explicit in typing. Better to be explicit than implicit.
  • Add tests that demonstrate the correct behavior of the change. Tests
    should fail without the change.
    • Parameter.name is an implementation detail, it's not in the documentation.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.

Sorry, something went wrong.

Uh oh!

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

All reactions
@AndreasBackx AndreasBackx added the typing Type annotations and stubs label Nov 9, 2024
@AndreasBackx
AndreasBackx force-pushed the typing/parameter branch 2 times, most recently from c40f6d3 to 07a78bd Compare November 9, 2024 17:18
AndreasBackx
AndreasBackx commented Nov 9, 2024
View reviewed changes
Comment thread src/click/core.py Resolved

Uh oh!

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

@AndreasBackx
AndreasBackx marked this pull request as ready for review November 9, 2024 17:33
@Rowlando13 Rowlando13 added this to the 8.2.1 milestone May 10, 2025
@davidism davidism modified the milestones: 8.2.1, 8.2.2 May 14, 2025
@Rowlando13 Rowlando13 modified the milestones: 8.2.2, 8.2.3 Jul 16, 2025
@Rowlando13 Rowlando13 removed this from the 8.2.3 milestone Aug 3, 2025
@Rowlando13

Rowlando13 commented Aug 23, 2025

Copy link
Copy Markdown
Member

@AndreasBackx Would you mind rebasing this so it can go out with 8.3.0?

All reactions

Sorry, something went wrong.

Uh oh!

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

@Rowlando13
Rowlando13 marked this pull request as draft August 23, 2025 07:39
@kdeldycke
kdeldycke changed the base branch from main to stable April 16, 2026 09:32
@kdeldycke
kdeldycke force-pushed the typing/parameter branch from aa4076f to c18107a Compare April 22, 2026 16:08
@kdeldycke

kdeldycke commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

@AndreasBackx I just reviewed this PR following our discussion at https://github.com/pallets/click/discussions/3329 and just realized it is not that big of a change. So I took the liberty to rebase it on top of stable and fix all remaining issues. The only careful part was adapting it to the UNSET/sentinel but in the end it worked well.

I will program this PR for inclusion for the next 8.4.0 release cycle. Can you double-check everything looks OK to you?

All reactions

Sorry, something went wrong.

Uh oh!

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

@kdeldycke kdeldycke added this to the 8.4.0 milestone Apr 22, 2026
@kdeldycke
kdeldycke marked this pull request as ready for review April 22, 2026 16:12
@kdeldycke
kdeldycke force-pushed the typing/parameter branch from c18107a to 2756275 Compare April 22, 2026 16:13
@kdeldycke kdeldycke changed the title Parameter typing improvements Parameter typing improvements Apr 22, 2026
@kdeldycke kdeldycke mentioned this pull request Apr 22, 2026
ParamType and other typing improvements #3371
Merged
@AndreasBackx

AndreasBackx commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator Author

Wow ya, thank you so much. I reviewed, or still am, reviewing the other ones. It's been a while but it looks as expected I think. This PRO looks as how I'd expect it. I'm kind of fuzzy about changing one None -> "" here in a few places but I think that's a fine change for the edge case it might just be and them being internal implementations.

kdeldycke reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@kdeldycke
kdeldycke force-pushed the typing/parameter branch from 2756275 to 5bd448d Compare April 27, 2026 13:00
@kdeldycke

kdeldycke commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Wow ya, thank you so much. I reviewed, or still am, reviewing the other ones. It's been a while but it looks as expected I think. This PRO looks as how I'd expect it. I'm kind of fuzzy about changing one None -> "" here in a few places but I think that's a fine change for the edge case it might just be and them being internal implementations.

Just refined some comparisons and removed an assert to clean up code.

So let's consider this PR ready to be merged upstream unless a review is raised.

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 13:11
@kdeldycke
kdeldycke force-pushed the typing/parameter branch from e3d0d37 to 854645f Compare April 27, 2026 13:12
@Rowlando13
Rowlando13 changed the base branch from stable to main April 29, 2026 07:27
@Rowlando13

Rowlando13 commented Apr 29, 2026

Copy link
Copy Markdown
Member

I will fix changes then this is ready for 8.4.0.

All reactions

Sorry, something went wrong.

Uh oh!

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

@AndreasBackx @kdeldycke
Parameter typing improvements
b02fdf9
Co-authored-by: Kevin Deldycke <[email protected]>
@kdeldycke
Cleanup code following type refining
da7774b
@kdeldycke
kdeldycke force-pushed the typing/parameter branch from 854645f to da7774b Compare April 29, 2026 08:53
@kdeldycke

kdeldycke commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

I will fix changes then this is ready for 8.4.0.

Just rebased on top of main with appropriate location of the changelog entry. Also solved a merge conflict due to #3371 merge.

This is ready to be merged into main.

All reactions

Sorry, something went wrong.

Uh oh!

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

davidism
davidism approved these changes Apr 29, 2026
View reviewed changes
@AndreasBackx
AndreasBackx merged commit ddede21 into main Apr 29, 2026
11 checks passed

Uh oh!

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

@AndreasBackx
AndreasBackx deleted the typing/parameter branch April 29, 2026 23:11
@kdeldycke

kdeldycke commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks @AndreasBackx for the merge and for removing the left-over branch!

All reactions

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

@davidism davidism davidism approved these changes
@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.

4 participants

@AndreasBackx @Rowlando13 @kdeldycke @davidism
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.