codeable_models.CEnum¶
-
class
codeable_models.
CEnum
(name=None, **kwargs)¶ CEnum
is used for defining enumerations.Superclasses:
CBundlable
- Parameters
name (str) – An optional name.
**kwargs –
Pass in any kwargs acceptable to superclasses. In addition,
CEnum
accepts:values
.The
values
kwarg accepts a list of string enumeration values in the form acceptable to theattributes
property.
Example: The following defines an enumeration with 4 values and then prints all the values with the
values
getter:player_state = CEnum("Player State", values=["Walk", "Run", "Attack", "Roll"]) print(f"player states: {player_state.values!s}")
Another example is provided in the document Class attributes.
-
delete
()¶ Deletes the enumeration. Calls
delete()
on superclass.- Returns
None
-
property
values
¶ Gets or sets the enumeration values.
- Type
list[str]