Skip to content

Positional-only argument instead of typer.Argument #292

Description

@flying-sheep

Is your feature request related to a problem

Using positional-only arguments is already a way to signal “this argument has no name”.

It’s shorter and natural to use

The solution you would like

def main(arg: str, /, opt: int = 1): pass

would work like

def main(arg: str = typer.Argument(...), opt: int = 1): pass

Describe alternatives you've considered

Continue using typer.Argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature, enhancement or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions