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

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-09 12:36 +0000

1from enum import Enum 1abcdefgh

2 

3import typer 1abcdefgh

4 

5 

6class NeuralNetwork(str, Enum): 1abcdefgh

7 simple = "simple" 1abcdefgh

8 conv = "conv" 1abcdefgh

9 lstm = "lstm" 1abcdefgh

10 

11 

12app = typer.Typer() 1abcdefgh

13 

14 

15@app.command() 1abcdefgh

16def main(network: NeuralNetwork = NeuralNetwork.simple): 1abcdefgh

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

18 

19 

20if __name__ == "__main__": 1abcdefgh

21 app() 1abcdefgh