Module Contents


OrderedDict(self,*args,**kwds) ‘Dictionary that remembers insertion order’
class OrderedDict(*args, **kwds)

‘Dictionary that remembers insertion order’

__init__(*args, **kwds)

Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.

__setitem__(key, value, dict_setitem=None)

‘od.__setitem__(i, y) <==> od[i]=y’

__delitem__(key, dict_delitem=None)

‘od.__delitem__(y) <==> del od[y]’


‘od.__iter__() <==> iter(od)’


‘od.__reversed__() <==> reversed(od)’


‘od.clear() -> None. Remove all items from od.’


od.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.


‘od.keys() -> list of keys in od’


‘od.values() -> list of values in od’


‘od.items() -> list of (key, value) pairs in od’


‘od.iterkeys() -> an iterator over the keys in od’


‘od.itervalues -> an iterator over the values in od’


‘od.iteritems -> an iterator over the (key, value) items in od’


od.update(E, **F) -> None. Update od from dict/iterable E and F.

If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v

pop(key, default=__marker)

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.

setdefault(key, default=None)

‘od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od’


‘od.__repr__() <==> repr(od)’


‘Return state information for pickling’


‘od.copy() -> a shallow copy of od’

fromkeys(iterable, value=None)

OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None).


od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive.


“od.viewkeys() -> a set-like object providing a view on od’s keys”


“od.viewvalues() -> an object providing a view on od’s values”


“od.viewitems() -> a set-like object providing a view on od’s items”