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.
Pull Request Template: Failing Tests for Tuple/List Handling Bugs
PR Title
Description
This PR adds a comprehensive test suite that exposes several bugs and inconsistencies in how Typer handles multiple values, particularly with tuple and list options.
Why This PR?
Per the project guidelines, I'm submitting failing tests first to:
🐛 Bugs Exposed by These Tests
Bug #1: Multiple Value Options Return
tupleInstead oflistTest Class:
TestListVsTupleInconsistencyWhen using
List[str]type hint withmultiple=True, Typer returns atupleinstead of alist.Impact:
.append()Related:
Bug #2: Tuple Options with
NoneDefaults Don't Handle Missing Values ProperlyTest Class:
TestTupleOptionNoneDefaultsWhen tuple options have
(None, None, None)as default, validation and None-handling is inconsistent.Impact:
Related to:
docs_src/multiple_values/options_with_multiple_values/tutorial001_py39.pyBug #3:
List[Tuple[str, str]]Not SupportedTest Class:
TestEdgeCasesDespite Click supporting nested tuples, Typer raises
AssertionErrorforList[Tuple[...]].Impact:
📁 Files Added
tests/test_typer_bugs.pyComprehensive test file with:
@pytest.mark.xfailfor known failures🧪 Test Structure
✅ Testing
How to Run These Tests
Current Test Results
@pytest.mark.xfaildocument known bugs@pytest.mark.skipneed dev install🎯 Next Steps (After This PR)
If maintainers confirm these are bugs worth fixing:
Follow-up PR Documentation full review #1: Fix Bug [FEATURE] Handling Path / File arguments easily #2 (Tuple None handling)
Follow-up PR [FEATURE] Handling Path / File arguments easily #2: Fix Bug Documentation full review #1 (List vs Tuple)
Follow-up PR Auto-document command with docstrings #3: Enhancement for Bug Auto-document command with docstrings #3 (Nested types)
📝 Notes
🔗 Related Issues
List[Tuple[...]]support✨ Contribution Checklist
💬 Questions for Maintainers
Thank you for reviewing! I'm happy to: