Package pike :: Module core :: Class ValueEnum
[hide private]
[frames] | no frames]

Class ValueEnum

source code

object --+        
         |        
      long --+    
             |    
          Enum --+
                 |
                ValueEnum
Known Subclasses:

Value Enumeration

Subclass this class to define enumerations of values. For example:

   class SomeEnumClass(Enum):
       FOO = 0
       BAR = 1
       BAZ = 2

Accessing SomeEnumClass.FOO will actually return a SomeEnumClass instance. Instances will return their symbolic names when str() is used.

Nested Classes [hide private]

Inherited from Enum: __metaclass__

Instance Methods [hide private]
 
__str__(self)
str(x)
source code

Inherited from Enum: __repr__

Inherited from long: __abs__, __add__, __and__, __cmp__, __coerce__, __div__, __divmod__, __float__, __floordiv__, __format__, __getattribute__, __getnewargs__, __hash__, __hex__, __index__, __int__, __invert__, __long__, __lshift__, __mod__, __mul__, __neg__, __nonzero__, __oct__, __or__, __pos__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __sizeof__, __sub__, __truediv__, __trunc__, __xor__, bit_length, conjugate

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Methods [hide private]
 
validate(cls, value)
Validate value as valid for enumeration.
source code

Inherited from Enum: import_items, items, names, values

Static Methods [hide private]

Inherited from Enum: __new__

Class Variables [hide private]
  permissive = False

Inherited from Enum (private): _nametoval, _valtoname

Properties [hide private]

Inherited from long: denominator, imag, numerator, real

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

validate(cls, value)
Class Method

source code 

Validate value as valid for enumeration.

This must be implemented in subclasses of Enum (but not ValueEnum or FlagEnum, which provide it). It should raise a ValueError on failure.

Overrides: Enum.validate
(inherited documentation)