class-constants

Is it possible to define a class constant inside an Enum?

Is it possible to define a class constant inside an Enum? Question: Python 3.4 introduces a new module enum, which adds an enumerated type to the language. The documentation for enum.Enum provides an example to demonstrate how it can be extended: >>> class Planet(Enum): … MERCURY = (3.303e+23, 2.4397e6) … VENUS = (4.869e+24, 6.0518e6) … …

Total answers: 6