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 — Reconcile default value passing and default activation by kdeldycke · Pull Request #3239 · pallets/click

Conversation

@kdeldycke

@kdeldycke kdeldycke commented Mar 2, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

This is an attempt to address #3111, and explore the consequences of reconciling the two meaning of the default parameter:

  1. "Pass this Python value to my function if the flag isn't used", i.e. when default=True then function gets True
  2. "Activate this flag by default", i.e. when default=True then function gets flag_value

A way to do that would be to consider default=True as a sentinel (yes, you can call me the sentinel-guy), for non-boolean flags. We do it lazily in the get_default method to not interfere with class instanciation, which we implemented in #3225 to fix #3121.

This has the side-effect of refining the test cases introduced in 06847da for #3030.

Sorry, something went wrong.

Uh oh!

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

All reactions
@kdeldycke kdeldycke mentioned this pull request Mar 2, 2026
New "default" behaviour in Click 8.3.x is broken for negative boolean flags #3111
Closed
@kdeldycke kdeldycke added this to the 8.3.2 milestone Mar 2, 2026
@kdeldycke
kdeldycke marked this pull request as draft March 2, 2026 07:54
@kdeldycke kdeldycke changed the title Reconcile default value passing and default activation WIP: Reconcile default value passing and default activation Mar 2, 2026
@kdeldycke kdeldycke added bug labels Mar 2, 2026
@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch from a61dcee to 22351f8 Compare March 2, 2026 08:00
@kdeldycke kdeldycke mentioned this pull request Mar 2, 2026
WIP: Rough out the idea of reference tables for kwargs and situations #3051
Draft
@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch from 22351f8 to 41ed4bc Compare March 2, 2026 09:10
@kdeldycke
kdeldycke marked this pull request as ready for review March 2, 2026 09:13
@kdeldycke

kdeldycke commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator Author

Ah sorry I fuck-up jungling with all these PRs to rebase. This commit 6c4a77b shouldn't have been pushed to stable. It should have been part of this PR. I'll revert the changes.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kdeldycke

kdeldycke commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator Author

Ok, juste revert stable as it was via: bb7be1f

All reactions

Sorry, something went wrong.

Uh oh!

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

@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch 2 times, most recently from 1296a4c to 4af30ca Compare March 2, 2026 09:21
@kdeldycke kdeldycke changed the title WIP: Reconcile default value passing and default activation Reconcile default value passing and default activation Mar 2, 2026
@Rowlando13 Rowlando13 modified the milestones: 8.3.2, 8.3.3 Mar 15, 2026
@vigneshakaviki vigneshakaviki mentioned this pull request Apr 5, 2026
Fix negative flag (flag_value=False) ignoring default=True #3308
Closed
@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch 6 times, most recently from 30aca6b to d34f72b Compare April 9, 2026 13:13
davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread docs/options.md Resolved

Uh oh!

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

davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread src/click/core.py Resolved

Uh oh!

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

@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch from d34f72b to 3da63b4 Compare April 13, 2026 06:25
@kdeldycke
Reconcile default value passing and default activation
c653ec8
Fix pallets#3111
Reintroduce a commit pushed by mistake in 6c4a77b and reverted in bb7be1f
Refine tests introduced in 06847da for pallets#3030
Document the interaction between `default` and `flag_value`
@kdeldycke
kdeldycke force-pushed the fix-bool-flag-default-true branch from f9f669d to c653ec8 Compare April 13, 2026 07:13
@Rowlando13
Merge branch 'stable' into fix-bool-flag-default-true
a683017
@Rowlando13
Rowlando13 merged commit 8c95c73 into pallets:stable Apr 16, 2026
11 checks passed

Uh oh!

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

@kdeldycke
kdeldycke deleted the fix-bool-flag-default-true branch April 16, 2026 08:26
@kdeldycke kdeldycke linked an issue Apr 16, 2026 that may be closed by this pull request
New "default" behaviour in Click 8.3.x is broken for negative boolean flags #3111
Closed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 1, 2026
@kdeldycke kdeldycke added parsing Parsing, parameters, commands, chaining, context and removed f:parameters labels Aug 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@davidism davidism davidism left review comments

Uh oh!

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

Assignees

No one assigned

Labels

parsing Parsing, parameters, commands, chaining, context

Projects

None yet

Milestone

8.3.3

Development

Successfully merging this pull request may close these issues.

New "default" behaviour in Click 8.3.x is broken for negative boolean flags

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.