Coverage for docs_src/parameter_types/enum/tutorial003_an.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1from enum import Enum 1abcdefgh
2from typing import List 1abcdefgh
4import typer 1abcdefgh
5from typing_extensions import Annotated 1abcdefgh
8class Food(str, Enum): 1abcdefgh
9 food_1 = "Eggs" 1abcdefgh
10 food_2 = "Bacon" 1abcdefgh
11 food_3 = "Cheese" 1abcdefgh
14def main(groceries: Annotated[List[Food], typer.Option()] = [Food.food_1, Food.food_3]): 1abcdefgh
15 print(f"Buying groceries: {', '.join([f.value for f in groceries])}") 1abcdefgh
18if __name__ == "__main__": 1abcdefgh
19 typer.run(main) 1abcdefgh