-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Empty tuple returned for Option instead of expected None
when no values passed
#410
Closed
7 tasks done
Labels
bug
Something isn't working
Comments
Andrew-Sheridan
changed the title
Incorrect type returned for Option defaults
Empty tuple returned for Option instead of expected Jul 3, 2022
None
when no values passed
The same thing happens with lists (an empty list is returned instead of |
Hi, thanks for the report! It looks like this is still an issue. I'll go ahead and merge this issue report with the similar report in #170, and close this one to keep the discussion in one thread. |
svlandeg
added
bug
Something isn't working
and removed
question
Question or problem
labels
Mar 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First Check
Commit to Help
Example Code
Description
If an option is declared as
foo: Optional[List[str]] = typer.Option(None)
it should provideNone
if nothing is passed. Currently it is providing()
, an empty tuple.In comparison
bar: Optional[str] = typer.Option(None)
does provideNone
when missing, as expected.Nothing passed causes the returned value for
foo
to be an empty tuple, it should beNone
:Passing values it returns a tuple of the values
Operating System
macOS
Operating System Details
No response
Typer Version
0.4.1
Python Version
3.10.0
Additional Context
#127 (comment)
The text was updated successfully, but these errors were encountered: