Coverage for docs_src/parameter_types/datetime/tutorial002_an.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1from datetime import datetime 1iabcdefgh

2 

3import typer 1iabcdefgh

4from typing_extensions import Annotated 1iabcdefgh

5 

6 

7def main( 1abcdefgh

8 launch_date: Annotated[ 

9 datetime, 

10 typer.Argument( 

11 formats=["%Y-%m-%d", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S", "%m/%d/%Y"] 

12 ), 

13 ], 

14): 

15 print(f"Launch will be at: {launch_date}") 1iabcdefgh

16 

17 

18if __name__ == "__main__": 1iabcdefgh

19 typer.run(main) 1iabcdefgh