Coverage for docs_src / parameter_types / enum / tutorial002_an_py310.py: 100%

11 statements  

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

1from enum import Enum 1abcdefg

2from typing import Annotated 1abcdefg

3 

4import typer 1abcdefg

5 

6 

7class NeuralNetwork(str, Enum): 1abcdefg

8 simple = "simple" 1abcdefg

9 conv = "conv" 1abcdefg

10 lstm = "lstm" 1abcdefg

11 

12 

13app = typer.Typer() 1abcdefg

14 

15 

16@app.command() 1abcdefg

17def main( 1abcdefg

18 network: Annotated[ 

19 NeuralNetwork, typer.Option(case_sensitive=False) 

20 ] = NeuralNetwork.simple, 

21): 

22 print(f"Training neural network of type: {network.value}") 1abcdefg

23 

24 

25if __name__ == "__main__": 1abcdefg

26 app() 1abcdefg