Package cjklib :: Module test :: Class ImmutableDict
[hide private]
[frames] | no frames]

Class ImmutableDict

source code


A hashable dict.

Instance Methods [hide private]
new empty dictionary

__init__(self, *args, **kwds)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__setitem__(self, key, value)
x[i]=y
source code
 
__delitem__(self, key)
del x[y]
source code
None
clear(self)
Remove all items from D.
source code
D.get(k,d), also set D[k]=d if k not in D
setdefault(self, k, default=None) source code
(k, v), remove and return some (key, value) pair as a
popitem(self)
2-tuple; but raise KeyError if D is empty
source code
None
update(self, other)
Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
source code
 
__hash__(self)
hash(x)
source code

Inherited from dict: __cmp__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, values

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwds)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

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

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__delitem__(self, key)
(Index deletion operator)

source code 

del x[y]

Overrides: dict.__delitem__
(inherited documentation)

clear(self)

source code 

Remove all items from D.

Returns: None
Overrides: dict.clear
(inherited documentation)

setdefault(self, k, default=None)

source code 
Returns: D.get(k,d), also set D[k]=d if k not in D
Overrides: dict.setdefault
(inherited documentation)

popitem(self)

source code 

2-tuple; but raise KeyError if D is empty

Returns: (k, v), remove and return some (key, value) pair as a
Overrides: dict.popitem
(inherited documentation)

update(self, other)

source code 

Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]

Returns: None
Overrides: dict.update
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)