Package gavo :: Package utils :: Module algotricks :: Class DeferringDict
[frames] | no frames]

Class DeferringDict

source code

object --+    
         |    
      dict --+
             |
            DeferringDict

is a dictionary that stores tuples of a callable and its arguments and will, on the first access, do the calls.

This is used below to defer the construction of instances in the class resolver to when they are actually used. This is important with interfaces, since they usually need the entire system up before they can sensibly be built.

Instance Methods
 
__setitem__(self, key, value)
x[i]=y
source code
 
__getitem__(self, key)
x[y]
source code
an iterator over the (key, value) items of D
iteritems(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables

Inherited from dict: __hash__

Properties

Inherited from object: __class__

Method Details

__setitem__(self, key, value)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

iteritems(self)

source code 
Returns: an iterator over the (key, value) items of D
Overrides: dict.iteritems
(inherited documentation)