Basic Types Library

Module documentation

mlib.core.types.Enum(*sequential, **named)[view]

Enum Class Factory

Works using an enumerated list:

>>> Types = Enum('test1', 'test2', 'test3')

Or using key/value pairs:

>>> Types = Enum(test1=0, test2=1, test3=2)

Or a mix:

>>> Types = Enum('test1', 'test2', 'test3', test=45)

And conversion for keys<==>values:

>>> print Types.key(0)
test1
>>> print Types.value('test1')
0

The Enum objects provide dot access for the values:

>>> print Types.test1
0
Returns:Created enum
Return type:Enum
class mlib.core.types.PropertyDict[view]

Bases: dict

Subclass of dict that allows the user to access keys as properties

Table Of Contents

Previous topic

Misc helper library

Next topic

Callbacks Module

This Page