Enumerated types or "enums" are a feature of many languages, including Python; enums provide a convenient way to collect up a bunch of related symbols that (typically) evaluate to integer values. The ...
The "enum" type in Python lets you create variables constrained to a predefined range of values. Learn how this built-in Python type can be used to express the state of something, whether as a string, ...
if x in Colour.names(): ... if x in Colour.values(): ... That provides both use cases, and because it's explicit it's always immediately obvious what is meant, even if you're not familiar with enums.
Some results have been hidden because they may be inaccessible to you
Show inaccessible results