@@ -1554,26 +1554,25 @@ either to emulate a sequence or to emulate a mapping; the difference is that for
15541554a sequence, the allowable keys should be the integers *k * for which ``0 <= k <
15551555N `` where *N * is the length of the sequence, or slice objects, which define a
15561556range of items. It is also recommended that mappings provide the methods
1557- :meth: `keys `, :meth: `values `, :meth: `items `, :meth: `get `,
1558- :meth: `clear `, :meth: `setdefault `,
1559- :meth: `pop `, :meth: `popitem `, :meth: `copy `, and
1557+ :meth: `keys `, :meth: `values `, :meth: `items `, :meth: `get `, :meth: `clear `,
1558+ :meth: `setdefault `, :meth: `pop `, :meth: `popitem `, :meth: `copy `, and
15601559:meth: `update ` behaving similar to those for Python's standard dictionary
1561- objects. The :mod: `UserDict ` module provides a :class: `DictMixin ` class to help
1562- create those methods from a base set of :meth: ` __getitem__ `,
1563- :meth: `__setitem__ `, :meth: `__delitem__ `, and :meth: `keys `. Mutable sequences
1564- should provide methods :meth: `append `, :meth: `count `, :meth: ` index `,
1565- :meth: `extend `, :meth: `insert `, :meth: `pop `, :meth: `remove `, :meth: `reverse ` and
1566- :meth: `sort `, like Python standard list objects. Finally, sequence types should
1567- implement addition (meaning concatenation) and multiplication (meaning
1568- repetition) by defining the methods :meth: `__add__ `, :meth: ` __radd__ `,
1569- :meth: `__iadd__ `, :meth: `__mul__ `, :meth: `__rmul__ ` and :meth: `__imul__ `
1570- described below; they should not define other numerical operators. It is
1571- recommended that both mappings and sequences implement the :meth: ` __contains__ `
1572- method to allow efficient use of the ``in `` operator; for mappings, `` in ``
1573- should search the mapping's keys; for sequences, it should search
1574- through the values. It is further recommended that both mappings and sequences
1575- implement the :meth: `__iter__ ` method to allow efficient iteration through the
1576- container; for mappings, :meth: `__iter__ ` should be the same as
1560+ objects. The :mod: `collections ` module provides a :class: `MutableMapping `
1561+ abstract base class to help create those methods from a base set of
1562+ :meth: `__getitem__ `, :meth: ` __setitem__ `, :meth: `__delitem__ `, and :meth: `keys `.
1563+ Mutable sequences should provide methods :meth: `append `, :meth: `count `,
1564+ :meth: `index `, :meth: `extend `, :meth: `insert `, :meth: `pop `, :meth: `remove `,
1565+ :meth: `reverse ` and :meth: ` sort `, like Python standard list objects. Finally,
1566+ sequence types should implement addition (meaning concatenation) and
1567+ multiplication (meaning repetition) by defining the methods :meth: `__add__ `,
1568+ :meth: `__radd__ `, :meth: `__iadd__ `, :meth: `__mul__ `, :meth: `__rmul__ ` and
1569+ :meth: ` __imul__ ` described below; they should not define other numerical
1570+ operators. It is recommended that both mappings and sequences implement the
1571+ :meth: ` __contains__ ` method to allow efficient use of the ``in `` operator; for
1572+ mappings, `` in `` should search the mapping's keys; for sequences, it should
1573+ search through the values. It is further recommended that both mappings and
1574+ sequences implement the :meth: `__iter__ ` method to allow efficient iteration
1575+ through the container; for mappings, :meth: `__iter__ ` should be the same as
15771576:meth: `keys `; for sequences, it should iterate through the values.
15781577
15791578.. method :: object.__len__(self)
0 commit comments