1
sleshep 2016 年 4 月 10 日
貌似有个__repr__属性
|
2
xiongbiao 2016 年 4 月 10 日 Color.red.value
|
3
tetsuo OP 那 Color.red 到底是实例还是属性啊,还有枚举类和普通的类有什么区别,作用是什么??求大神解答
|
4
bp0 2016 年 4 月 10 日
建议看看单例模式
|
6
xuyuxi 2016 年 4 月 10 日
Color().red
|
7
congeec 2016 年 4 月 10 日
@tetsuo
一楼说的对 ``` >>> str(Color.red) 'Color.red' >>> repr(Color.red) '<Color.red: 1>' ``` https://docs.python.org/3/library/enum.html?highlight=enum#allowed-members-and-attributes-of-enumerations 为嘛不看文档? |
8
qnnnnez 2016 年 4 月 10 日 via Android
|
9
qnnnnez 2016 年 4 月 10 日 via Android
|
10
Drifter 2016 年 4 月 10 日
|
11
ryanking8215 2016 年 4 月 11 日
class Color(enum.IntEnum)
|