I have this piece of code:
import enum
class Color(enum.Enum):
RED = '1'
BLUE = '2'
GREEN = '3'
def get_color_return_something(some_color):
pass
How do I properly add type annotations to the some_color
variable in this function, if I suppose that I'll receive an enum attribute from the Color enum (for example: Color.RED
)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…