79310826

Date: 2024-12-27 03:11:07
Score: 0.5
Natty:
Report link

Since Python 3.13, we now have EnumDict in the enum module.

from enum import EnumDict

class Color(EnumDict):
    RED = "RED"
    GREEN = "GREEN"
    BLUE = "BLUE"

This allows you to do exactly what you want, because this enum behaves like a Python dictionary.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: BoĊĦtjan Mejak