microprobe.utils.misc.RejectingOrderedDict¶
-
class
RejectingOrderedDict
(**kwds)[source]¶ Bases:
collections.OrderedDict
An ordered dictionary that raises an exception if key is already set.
-
__init__
(**kwds)¶ Initialize an ordered dictionary. The signature is the same as regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
Methods
__init__
(**kwds)Initialize an ordered dictionary. clear
()copy
()fromkeys
(S[, v])If not specified, the value defaults to None. get
(k[,d])has_key
(k)items
()iteritems
()od.iteritems -> an iterator over the (key, value) pairs in od iterkeys
()itervalues
()od.itervalues -> an iterator over the values in od keys
()pop
(k[,d])value. popitem
()Pairs are returned in LIFO order if last is true or FIFO order if false. setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v values
()viewitems
()viewkeys
()viewvalues
()
-
clear
() → None. Remove all items from od.¶
-
copy
() → a shallow copy of od¶
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.¶ If not specified, the value defaults to None.
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
has_key
(k) → True if D has a key k, else False¶
-
items
() → list of (key, value) pairs in od¶
-
iteritems
()¶ od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od¶
-
itervalues
()¶ od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding¶ value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.¶ Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od¶
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od¶
-
viewitems
() → a set-like object providing a view on od's items¶
-
viewkeys
() → a set-like object providing a view on od's keys¶
-
viewvalues
() → an object providing a view on od's values¶
-