Coverage for docs_src/parameter_types/number/tutorial002.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-19 20:29 +0000

1import typer 1abcdefghi

2 

3app = typer.Typer() 1abcdefghi

4 

5 

6@app.command() 1abcdefghi

7def main( 1abcdefghi

8 id: int = typer.Argument(..., min=0, max=1000), 

9 rank: int = typer.Option(0, max=10, clamp=True), 

10 score: float = typer.Option(0, min=0, max=100, clamp=True), 

11): 

12 print(f"ID is {id}") 1abcdefghi

13 print(f"--rank is {rank}") 1abcdefghi

14 print(f"--score is {score}") 1abcdefghi

15 

16 

17if __name__ == "__main__": 1abcdefghi

18 app() 1abcdefghi