标签: java python enums
在Java中,我可以这样做:
public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }
我得到一个Day类,它包含变量名称的字符串值变量。
如何在python中实现相同的效果?
我是否必须逐一列出?
class Day: SUNDAY = 'SUNDAY' YADA = 'YADA' SATURDAY = 'SATURDAY'