Coverage for docs_src/parameter_types/number/tutorial001.py: 100%
7 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-19 20:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-19 20:29 +0000
1import typer 1abcdefghi
3app = typer.Typer() 1abcdefghi
6@app.command() 1abcdefghi
7def main( 1abcdefghi
8 id: int = typer.Argument(..., min=0, max=1000),
9 age: int = typer.Option(20, min=18),
10 score: float = typer.Option(0, max=100),
11):
12 print(f"ID is {id}") 1abcdefghi
13 print(f"--age is {age}") 1abcdefghi
14 print(f"--score is {score}") 1abcdefghi
17if __name__ == "__main__": 1abcdefghi
18 app() 1abcdefghi