3 ms·
Read the section on IntEnums[1]: IntEnum values behave like integers in other ways you'd expect: >>> int(Shape.circle) 1 >>> ['a', 'b', 'c'][Shape.c
by pyre 14y ago
Read the section on IntEnums[1]:
IntEnum values behave like integers in other ways
you'd expect:
>>> int(Shape.circle)
1
>>> ['a', 'b', 'c'][Shape.circle]
'b'
>>> [i for i in range(Shape.square)]
[0, 1]
[1] http://www.python.org/dev/peps/pep-0435/#intenum http://www.python.org/dev/peps/pep-0435/#intenum