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 — Deprecate parameter names that are: not a Python identifier, or a Python Keyword, or not lower-cased by kdeldycke · Pull Request #3866 · pallets/click

Conversation

@kdeldycke

@kdeldycke kdeldycke commented Sep 11, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

This PR prepares the ground for #3827, which is going to refuse parameter names that are not valid Python identifiers.

This add DeprecationWarning that detect when Parameter, Argument or Option gets a name that will be not allowed in the future 9.0.0 release:

  • a parameter that is not a Python identifier (check against str.identifier)
  • a parameter that is a Python keyword (check against keyword.iskeyword)
  • an option name that is nor lower-cased

This PR also copy the majority of tests that were originally proposed in #3827, so the behavior of the name is locked down and frozen. This will prevent tweaking or introducing regressions during the full 8.x cycle.

This PR also inaugurate the 8.6.0 release on main.

Historical details

Of course, I fucked-up the same way I fucked-up 2 months ago with #3701 , when juggling between main and stable branches made me push to stable. 😫

So:

  • I pushed by mistake e2bddbc
  • I reverted my mistake on stable with d036881
  • And this PR is what it should have been all along

Anyway, this was resolved by resyncing both branches with #3876 .

Sorry, something went wrong.

Uh oh!

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

All reactions
@kdeldycke kdeldycke added the parsing Parsing, parameters, commands, chaining, context label Sep 11, 2026
@kdeldycke kdeldycke added this to the 8.5.1 milestone Sep 11, 2026
@kdeldycke kdeldycke mentioned this pull request Sep 11, 2026
Require a parameter name to be a non-keyword Python identifier #3827
Draft
@kdeldycke
kdeldycke requested review from Rowlando13 and davidism September 11, 2026 13:34
@kdeldycke kdeldycke added the tests Click's own test suite and CI workflows label Sep 11, 2026
@kdeldycke
kdeldycke force-pushed the deprecate-non-identifier-names branch from 62cff1d to 3c5be86 Compare September 11, 2026 13:35
@davidism

davidism commented Sep 11, 2026

Copy link
Copy Markdown
Member

What do you think, should we also check keyword.iskeyword? Might be good to warn about it and see if anything comes up.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kdeldycke

kdeldycke commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

What do you think, should we also check keyword.iskeyword? Might be good to warn about it and see if anything comes up.

Ah. That might be a good idea: test drive that check during a long 8.x cycle and see if it show up... If I implement this, what kind of severity should it triggers? A DeprecationWarning like non-Python-IDs ?

All reactions

Sorry, something went wrong.

Uh oh!

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

@davidism

davidism commented Sep 11, 2026

Copy link
Copy Markdown
Member

Deprecation seems fine. Like I said in the other thread, it could be more disruptive, but it also seems to match the intention of the str.isidentifier check.

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.

@kdeldycke
kdeldycke force-pushed the deprecate-non-identifier-names branch from 3c5be86 to eb37bea Compare September 11, 2026 14:24
@kdeldycke
kdeldycke force-pushed the deprecate-non-identifier-names branch from eb37bea to a5af540 Compare September 21, 2026 10:57
@kdeldycke

kdeldycke commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

Just implemented the double isidentifier() / iskeyword() deprecation check in a common _check_name_is_usable() internal function. The later is maybe a bit too verbose as I distinguished the 2 cases and reused the deprecation explanation from docs/upgrade-guides.md. Can make it way smaller if you want to.

This is ready to be reviewed for eventual merge.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kdeldycke kdeldycke changed the title Deprecate a parameter name that is not a Python identifier Deprecate parameter names that are: not a Python identifier, or a Python Keyword, or not lower-cased Sep 21, 2026
kdeldycke added a commit to kdeldycke/click-extra that referenced this pull request Sep 21, 2026
@kdeldycke
Skip ecosystem frames when placing deprecation warnings
a38a2d2
Click is about to get a similar stack-level inspection utility in pallets/click#3866.
@Rowlando13

Rowlando13 commented Sep 21, 2026

Copy link
Copy Markdown
Member

@kdeldycke this should merge into main. I don't we should issue new deprecations on bug fix versions.

davidism 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.

@kdeldycke
kdeldycke changed the base branch from stable to main September 22, 2026 06:27
@kdeldycke kdeldycke modified the milestones: 8.5.1, 8.6.0 Sep 22, 2026
kdeldycke added 2 commits September 22, 2026 10:39
@kdeldycke
Start 8.6.0.
a59f7c6
@kdeldycke
Deprecate a parameter name that Click 9.0 will refuse or lower case
b90faad
Prepares the ground for pallets#3827
@kdeldycke
kdeldycke force-pushed the deprecate-non-identifier-names branch from a5af540 to b90faad Compare September 22, 2026 06:48
@kdeldycke

kdeldycke commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

@kdeldycke this should merge into main. I don't we should issue new deprecations on bug fix versions.

OK make sense. So I retargeted the main branch, added a new commit in this PR to inaugurate the 8.6.0 release and updated the doc to target that release. And this time I hope I did not made any mistake juggling with the two branches... 🫣

All reactions

Sorry, something went wrong.

Uh oh!

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

Rowlando13
Rowlando13 approved these changes Sep 23, 2026
View reviewed changes
@Rowlando13
Rowlando13 merged commit 06b2a67 into pallets:main Sep 23, 2026
12 checks passed

Uh oh!

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

@kdeldycke
kdeldycke deleted the deprecate-non-identifier-names branch September 23, 2026 04:51
kdeldycke added a commit to kdeldycke/click that referenced this pull request Sep 23, 2026
@kdeldycke
Require a parameter name to be a non-keyword Python identifier
3dcde39
Make `DeprecationWarning` from pallets#3866 into `TypeError`
kdeldycke added a commit to kdeldycke/click that referenced this pull request Sep 23, 2026
@kdeldycke
Require a parameter name to be a non-keyword Python identifier
d8a0c46
Make `DeprecationWarning` from pallets#3866 into `TypeError`
kdeldycke added a commit to kdeldycke/click that referenced this pull request Oct 5, 2026
@kdeldycke
Require a parameter name to be a non-keyword Python identifier
1652ae5
Make `DeprecationWarning` from pallets#3866 into `TypeError`
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

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

Uh oh!

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

Assignees

No one assigned

Labels

parsing Parsing, parameters, commands, chaining, context tests Click's own test suite and CI workflows

Projects

None yet

Milestone

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