Hide Sentinel.UNSET values as None in lookup_default()#3224
Open
kdeldycke wants to merge 1 commit intopallets:mainfrom
Open
Hide Sentinel.UNSET values as None in lookup_default()#3224kdeldycke wants to merge 1 commit intopallets:mainfrom
Sentinel.UNSET values as None in lookup_default()#3224kdeldycke wants to merge 1 commit intopallets:mainfrom
Conversation
fe2f919 to
2112621
Compare
2112621 to
aaf99a3
Compare
Collaborator
Author
|
Also note that the unnatural |
Member
|
This is fine for the bug fix, but you're right that this is getting messy. We need to figure out a long term solution. |
Collaborator
Author
|
@Rowlando13, should we merge? to |
Collaborator
|
Main. @kdeldycke Getting this fix is good, but it would be better if we try to make larger fixes to simplify the issues Click has accumulated. |
Collaborator
|
9.0 should be next release. |
Collaborator
Author
|
Looks like @davidism is in favor on Discord of getting 8.3.2 out first, which could include this fix, which as limited blast radius. 😁 |
kdeldycke
added a commit
to kdeldycke/click-extra
that referenced
this pull request
Feb 21, 2026
Collaborator
Author
|
FYI, just tested this fix against my own Click Extra codebase and could not find any regression: kdeldycke/click-extra@4bbd387 |
Collaborator
|
Sounds good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR address issue #3145, in which the
UNSETsentinel is leaking intolookup_default()when users have overriding it.This changes prevent
lookup_default()to returnUNSETas-is, and masquerade it asNone. To account for this change inlookup_default()behavior, I had to update some internal checks around defaults.Additionally, to prevent any side-effects, I added a couple of tests to fill the gaps in coverage of
lookup_default(), especially around treatment of absence of value and value of absence.Important
I did use LLMs (Claude Opus 4.6) in the process of creating this PR, but as a co-worker to criticize my changes and modifications, not as a vibe-coding agent. This PR was carefully written, edited and reviewed by me.