The enum module

The enum module contains the Enum class which provides the ability to make a class act as an enumeration.

The Enum class

Inheritance diagram of pyamp.patterns.enum.Enum

class pyamp.patterns.enum.Enum[source]

The Enum class provides the ability to create a class which acts as an enumeration. Class properties can be set as the enumeration values, and a dictionary of the entire enumeration keys and values can be retrieved.

Example:

class Test(Enum):
    Prop1 = "This is a string property"
    Prop2 = 123
    Another = True
    AnyIdName = {"test": 0}
    ListId = [1, 2, 3, 4]

Calling Test.get(), returns:

{ "Prop1": "This is a string property",
  "Prop2": 123,
  "Another": True,
  "AnyIdName": {"test": 0},
  "ListId": [1, 2, 3, 4]
}

Create an Enum.

classmethod get()[source]

Get the list of configured enumeration values.

Table Of Contents

Previous topic

The decorators module

Next topic

The ui module

This Page