Table of Contents

Class: EigenDict ./src/peak/util/EigenData.py

Mapping whose entries can be changed as long as they are unread

An EigenDict is used to hold a set of configuration values that should not be changed once they are read. It offers essentially the same interface as a standard Python dictionary, with the following twists:

  • Operations on individual entries are delegated to EigenCell objects, so a given entry cannot be written to or deleted once it has been read, or its existence inspected by has_key(), get(), etc.

  • Operations on the dictionary as a whole, such as keys(), values(), copy(), __cmp__(), __repr__(), etc., will lock the entire dictionary and no further modifications will be allowed.

  • __len__() and popitem() methods are not available.

  • .copy() returns a standard Python dictionary, not an EigenDict

Base Classes   
object
Methods   
__cmp__
__contains__
__delitem__
__getitem__
__init__
__iter__
__repr__
__setitem__
_setCell
clear
copy
get
has_key
items
iteritems
iterkeys
itervalues
keys
lock
setdefault
update
values
  __cmp__ 
__cmp__ ( self,  dict )

  __contains__ 
__contains__ ( self,  key )

  __delitem__ 
__delitem__ ( self,  key )

  __getitem__ 
__getitem__ ( self,  key )

Exceptions   
KeyError, key
  __init__ 
__init__ ( self,  dict=None )

  __iter__ 
__iter__ ( self )

  __repr__ 
__repr__ ( self )

  __setitem__ 
__setitem__ (
        self,
        key,
        item,
        )

  _setCell 
_setCell ( self,  key )

Return a new or existing EigenCell for key

If there is no EigenCell stored under key, return a new EigenCell and store it. If the dictionary is locked, return an empty, locked EigenCell instead of creating a new one. This ensures that no new entries can be created if locked.

  clear 
clear ( self )

  copy 
copy ( self )

  get 
get (
        self,
        key,
        failobj=None,
        factory=None,
        )

  has_key 
has_key ( self,  key )

  items 
items ( self )

  iteritems 
iteritems ( self )

  iterkeys 
iterkeys ( self )

  itervalues 
itervalues ( self )

  keys 
keys ( self )

  lock 
lock ( self )

Lock the dictionary, ensuring that its contents cannot change

This method locks all the dictionary's cells, and sets a flag to ensure that no new cells will be created. It also discards empty cells, for the convenience of routines that operate on the dictionary as a whole, like keys() and values().

  setdefault 
setdefault (
        self,
        key,
        failobj=None,
        )

  update 
update ( self,  dict )

  values 
values ( self )


Table of Contents

This document was automatically generated on Mon May 20 01:11:19 2019 by HappyDoc version 2.1