Home | Trees | Indices | Help |
|
---|
|
object --+ | EnumBase --+ | enum
Base class for all enumeration types. Supports both string and integer enumeration values. Examples:
>>> class MolTypes(enum): DNA, RNA = range(2) <MolTypes: RNA=1, DNA=0> >>> class MolTypes(enum): DNA=1; RNA=2 <MolTypes: RNA=2, DNA=1> >>> MolTypes.DNA 1 >>> MolTypes.DNA == 1 True >>> int(MolTypes.DNA) 1 >>> repr(MolTypes.DNA) 'DNA' >>> type(MolTypes.DNA) L{EnumItem} instance
Note: The recommended way to create an enum is to define a public subclass of enum in the global namespace of your module. Nesting the enum in another class for example will break pickling.
Instance Methods | |||
|
|||
Inherited from |
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 4 20:19:06 2017 | http://epydoc.sourceforge.net |