10000 ✨ Implement list parsing from string with separators. by libklein · Pull Request #800 · fastapi/typer · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Implement list parsing from string with separators. #800

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Do not allow multi-character separators for List[T] parsing.
  • Loading branch information
libklein committed Apr 17, 2024
commit cec52c953e60c29e8fac466b9a604295a71fcb31
7 changes: 3 additions & 4 deletions typer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ def __init__(
self.multiple_separator = multiple_separator

if self.multiple_separator is not None:
if self.multiple_separator.strip() == "":
raise UnsupportedMultipleSeparatorError(
self.name, self.multiple_separator
)
self.multiple_separator = self.multiple_separator.strip()
if len(self.multiple_separator) != 1:
raise UnsupportedMultipleSeparatorError(self.name, multiple_separator)

if not isinstance(self.type, list):
raise MultipleSeparatorForNonListTypeError(self.name)
Expand Down
Loading
0