Package ndg :: Package xacml :: Package utils :: Class RestrictedKeyNamesDict
[hide private]

Class RestrictedKeyNamesDict

source code

object --+    
         |    
      dict --+
             |
            RestrictedKeyNamesDict

Utility class for holding a constrained list of key names

Instance Methods [hide private]
new empty dictionary

__init__(self, *arg, **kw)
Alter standard dict() initialisation to fix key names set at initialisation
source code
 
__setitem__(self, key, val)
x[i]=y
source code
None
update(self, d, **kw)
Update D from dict/iterable E and F.
source code

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

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

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *arg, **kw)
(Constructor)

source code 

Alter standard dict() initialisation to fix key names set at initialisation

Returns:
new empty dictionary

Overrides: object.__init__

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

source code 

x[i]=y

Parameters:
  • key (any) - key for item to set
  • val (any) - value to set for this key
Overrides: dict.__setitem__

update(self, d, **kw)

source code 

Update D from dict/iterable E and F. If E has a .keys() method, does: for k in E: D[k] = E[k] If E lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

Parameters:
  • d (dict) - dictionary to update from
  • kw (dict) - keywords to update dictionary with
Returns: None
Overrides: dict.update