Lines Matching refs:OrderedDict
29 :class:`OrderedDict` dict subclass that remembers the order entries were added .. ve…
631 'Return a new OrderedDict which maps field names to their values'
632 return OrderedDict(zip(self._fields, self))
648 'Exclude the OrderedDict from pickling'
700 Return a new :class:`OrderedDict` which maps field names to their corresponding
705 OrderedDict([('x', 11), ('y', 22)])
708 Returns an :class:`OrderedDict` instead of a regular :class:`dict`.
797 :class:`OrderedDict` objects
804 .. class:: OrderedDict([items])
807 methods. An *OrderedDict* is a dict that remembers the order that keys
814 .. method:: OrderedDict.popitem(last=True)
823 Equality tests between :class:`OrderedDict` objects are order-sensitive
825 Equality tests between :class:`OrderedDict` objects and other
827 dictionaries. This allows :class:`OrderedDict` objects to be substituted
830 The :class:`OrderedDict` constructor and :meth:`update` method both accept
836 `Equivalent OrderedDict recipe <https://code.activestate.com/recipes/576693/>`_
839 :class:`OrderedDict` Examples and Recipes
849 >>> OrderedDict(sorted(d.items(), key=lambda t: t[0]))
850 OrderedDict([('apple', 4), ('banana', 3), ('orange', 2), ('pear', 1)])
853 >>> OrderedDict(sorted(d.items(), key=lambda t: t[1]))
854 OrderedDict([('pear', 1), ('orange', 2), ('banana', 3), ('apple', 4)])
857 >>> OrderedDict(sorted(d.items(), key=lambda t: len(t[0])))
858 OrderedDict([('pear', 1), ('apple', 4), ('orange', 2), ('banana', 3)])
869 class LastUpdatedOrderedDict(OrderedDict):
875 OrderedDict.__setitem__(self, key, value)
880 class OrderedCounter(Counter, OrderedDict):
884 return '%s(%r)' % (self.__class__.__name__, OrderedDict(self))
887 return self.__class__, (OrderedDict(self),)