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

7 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-03-26 21:46 +0000

1import typer 1abcdefg

2 

3app = typer.Typer() 1abcdefg

4 

5 

6@app.command() 1abcdefg

7def main( 1abcdefg

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}") 1abcdefg

13 print(f"--age is {age}") 1abcdefg

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

15 

16 

17if __name__ == "__main__": 1abcdefg

18 app() 1abcdefg