两个枚举之间是可以做等值比较的
看代码:
from enum import Enum
class Color(Enum):
YELLOW = 1
GREEN = 2
BLACK = 3
RED = 4
class Color1(Enum):
YELLOW = 1
GREEN = 2
BLACK = 3
RED = 4
result = Color.GREEN == Color.GREEN
# a = Color.GREE