Package pygeodesy :: Module datum :: Class _Enum |
[frames] | no frames]

# Class _Enum

      object --+
               |
            dict --+
                   |
      object --+   |
               |   |
    bases._Named --+
                   |
                  _Enum

(INTERNAL) Enum-like `dict` sub-class.

Instance Methods
    new empty dictionary
__init__(self, name) New `Enum`. |
__getattr__(self, attr) |
__repr__(self) repr(x) |
__str__(self) str(x) |
find(self, inst) Find a registered instance. |
unregister(self, name_or_inst) Remove a registered instance. |
Inherited from `dict`: `__cmp__`, `__contains__`, `__delitem__`, `__eq__`, `__ge__`, `__getattribute__`, `__getitem__`, `__gt__`, `__iter__`, `__le__`, `__len__`, `__lt__`, `__ne__`, `__new__`, `__setitem__`, `__sizeof__`, `clear`, `copy`, `fromkeys`, `get`, `has_key`, `items`, `iteritems`, `iterkeys`, `itervalues`, `keys`, `pop`, `popitem`, `setdefault`, `update`, `values`, `viewitems`, `viewkeys`, `viewvalues` Inherited from `object`: `__delattr__`, `__format__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__subclasshook__`

Class Variables
Inherited from `dict`: `__hash__`

Properties
Inherited from `bases._Named`: `classname`, `classnaming`, `name` Inherited from `object`: `__class__`

Method Details

### __init__(self, name) (Constructor) |
New `Enum`. Parameters: `name` - Name (`str`). Returns:
    new empty dictionary
Overrides: object.__init__

### __repr__(self) (Representation operator) |
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(self) (Informal representation operator) |
str(x) Overrides: object.__str__ (inherited documentation)

### find(self, inst) |
Find a registered instance. Parameters: `inst` - The instance (any `type`). Returns: The inst's name (`str`) if found, `None` otherwise.

### unregister(self, name_or_inst) |
Remove a registered instance. Parameters: `name_or_inst` - Name (`str`) of or the instance (any `type`). Returns: The unregistered instance. Raises: `NameError` - No instance with that name. `ValueError` - No such instance.