# Class k.p.enum(int):

Part of kiwi.python View In Hierarchy

Known subclasses: kiwi.enums.Alignment, kiwi.enums.ComboColumn, kiwi.enums.ComboMode, kiwi.enums.Direction, kiwi.enums.ListType, kiwi.enums.SearchFilterPosition, kiwi.ui.search.DateSearchFilter.Type

enum is an enumered type implementation in python.

To use it, define an enum subclass like this:

    >>> from kiwi.python import enum
    >>>
    >>> class Status(enum):
    >>>     OPEN, CLOSE = range(2)
    >>> Status.OPEN
    '<Status value OPEN>'

All the integers defined in the class are assumed to be enums and values cannot be duplicated

Class Method | __class_init__ | Undocumented
Class Method | get | Lookup an enum by value
Method | __new__ | Create a new Enum.
Method | __str__ | Undocumented

@classmethod
def __class_init__(cls, ns):
Undocumented
@classmethod
def get(cls, value):
Lookup an enum by value

Parameters | value | the value

def __new__(cls, value, name):
Create a new Enum.

Parameters | value | value of the enum
| name | name of the enum

def __str__(self):
Undocumented