我找到了一种简单的方法来实现(破解)一个枚举到Python 中: class MyEnum: VAL1, VAL2, VAL3 = range(3) 然后我可以这样称呼它: bob = MyEnum.VAL1
確定! 回上一頁