Skip to content

Auto-detect type=UNPROCESSED when flag_value has non-basic types#3363

Merged
Rowlando13 merged 3 commits intopallets:mainfrom
kdeldycke:flag-value-unprocessed-auto-detect
Apr 29, 2026
Merged

Auto-detect type=UNPROCESSED when flag_value has non-basic types#3363
Rowlando13 merged 3 commits intopallets:mainfrom
kdeldycke:flag-value-unprocessed-auto-detect

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

This closes #2012 by addressing the left-over cases that were not fixed in #3030.

With this PR, when flag_value is not a basic Python type, like a class or an Enum value, we do not force the stringification imposed by convert_type. But still use the later for detection of the guessed type.

This way we can preserves programmer-provided Python objects as-is, without requiring having type=click.UNPROCESSED sets explicitly, restoring pre-8.0.0 user-friendlyness and user expectations.

@kdeldycke kdeldycke added this to the 8.4.0 milestone Apr 21, 2026
@kdeldycke kdeldycke added the bug label Apr 21, 2026
@kdeldycke kdeldycke linked an issue Apr 21, 2026 that may be closed by this pull request
@kdeldycke kdeldycke force-pushed the flag-value-unprocessed-auto-detect branch from 758d9be to 4e4c7a6 Compare April 21, 2026 11:05
@Rowlando13 Rowlando13 changed the base branch from stable to main April 29, 2026 06:44
@Rowlando13 Rowlando13 merged commit b03f211 into pallets:main Apr 29, 2026
12 checks passed
@kdeldycke kdeldycke deleted the flag-value-unprocessed-auto-detect branch April 29, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flag_value is passed through ParamType.convert

2 participants