79098112

Date: 2024-10-17 12:42:54
Score: 1
Natty:
Report link

In your code Color is really Colors. You should do:

Color = str

class Colors(enum.Enum):
    RED: Color = '1'
    BLUE: Color = '2'
    GREEN: Color = '3'

and then

def get_color_return_something(some_color: Color):
    pass

get_color_return_something(Colors.RED)

would work and be precisely typed.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: MASTER_OF_CODE