'Update from another OrderedDict or sequence of (key, value) pairs
>>> d = OrderedDict(((1, 0), (0, 1)))
>>> d.update(OrderedDict(((1, 3), (3, 2), (2, 1))))
>>> d
OrderedDict([(1, 3), (0, 1), (3, 2), (2, 1)])
>>> d.update({4: 4})
Traceback (most recent call last):
TypeError: undefined order, cannot get items from dict
>>> d.update((4, 4))
Traceback (most recent call last):
TypeError: cannot convert dictionary update sequence element "4" to a 2-item sequence'

def update(self, from_od):

    if isinstance(from_od, OrderedDict):
        for (key, val) in from_od.items():
            self[key] = val
    elif isinstance(from_od, dict):
        raise TypeError('undefined    order,    cannot    get    items    from    dict')
    else:
        for item in from_od:
            try:
                (key, val) = item
            except TypeError:
                raise TypeError(('cannot    convert    dictionary    update    sequence    element    "%s"    to    a    2-item    sequence' % item))
            self[key] = val
