Skip to content

Reconcile default value passing and default activation#3239

Open
kdeldycke wants to merge 5 commits intopallets:stablefrom
kdeldycke:fix-bool-flag-default-true
Open

Reconcile default value passing and default activation#3239
kdeldycke wants to merge 5 commits intopallets:stablefrom
kdeldycke:fix-bool-flag-default-true

Conversation

@kdeldycke
Copy link
Collaborator

@kdeldycke kdeldycke commented Mar 2, 2026

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.

@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 f:parameters feature: input parameter types 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 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
Copy link
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.

@kdeldycke
Copy link
Collaborator Author

Ok, juste revert stable as it was via: bb7be1f

@kdeldycke kdeldycke force-pushed the fix-bool-flag-default-true branch from 41ed4bc to 1296a4c Compare March 2, 2026 09:19
@kdeldycke kdeldycke force-pushed the fix-bool-flag-default-true branch 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:parameters feature: input parameter types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant