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 fixes the various processing issues I noticed while investigating #1649.
multiple=True
is set andnargs
> 1,default
must be a list of tuples. Setting such a default is detected correctly to produce atype
ofTuple
.get_default
is now tried inconsume_value
with the other sources, rather than being tried infull_process_value
after callingprocess_value
. This makes the processing more consistent.consume_value
must now return a(value, ParameterSource)
tuple.UUID
andDateTime
types were adjusted so that theirconvert
method allows a value that is already the correct type. This was already the case for other types.Option.consume_value
instead offull_process_value
to match the other sources.ParameterSource.PROMPT
to track that the value was prompted for. This is currently set even if the user confirms the default value.None
. This fixes an issue an argument with a default value wouldn't be completed. Also use the parameter source to check if aprompt
should happen.None
if a default was not provided andnargs
> 1.multiple=True
ornargs=-1
returns an empty tuple. The workaround described in Tuples as Multi Value Options throw an TypeError #472 of settingdefault=(None, None)
still works, but is no longer necessary.Checklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.