bug: Variadic list typer.Argument with default value broken between 0.25 and 0.26 #1811
-
First Check
Example Codefrom typing import Annotated
import typer
app = typer.Typer()
@app.command()
def run(
tests: Annotated[list[str], typer.Argument()] = ["foo"],
) -> None:
print(tests)
def main():
app()
if __name__ == "__main__":
main()DescriptionSee the repro. Argument $ uv run --quiet --with typer==0.25.0 -- python repro.py
['foo']versus $ uv run --quiet --with typer==0.26.0 -- python repro.py
[]I could not find any documentation stating that this behaviour is not supported or that this is a breaking change going from 0.25 to 0.26. Operating SystemLinux Operating System DetailsUbuntu 24.04 (running in WSL) Project Version0.26.4 Python VersionPython 3.12.3 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
That looks like a potential bug. Thanks for the report, I'll look into it! |
Beta Was this translation helpful? Give feedback.
-
|
Confirmed that this is a bug, I'll push a fix later today! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
PR: #1821 Released in Typer 0.26.6 🎉 |
Beta Was this translation helpful? Give feedback.
PR: #1821
Released in Typer 0.26.6 🎉