Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a502de

Browse files
committed
Merged revisions 82952,82954 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r82952 | benjamin.peterson | 2010-07-18 09:23:36 -0500 (Sun, 18 Jul 2010) | 1 line use classmethod ........ r82954 | benjamin.peterson | 2010-07-18 09:27:02 -0500 (Sun, 18 Jul 2010) | 1 line nest method and attribute doc ........
1 parent 721e9aa commit 7a502de

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

Doc/library/collections.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
527527
:class:`defaultdict` objects support the following method in addition to the
528528
standard :class:`dict` operations:
529529

530-
.. method:: defaultdict.__missing__(key)
530+
.. method:: __missing__(key)
531531

532532
If the :attr:`default_factory` attribute is ``None``, this raises a
533533
:exc:`KeyError` exception with the *key* as argument.
@@ -547,7 +547,7 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
547547
:class:`defaultdict` objects support the following instance variable:
548548

549549

550-
.. attribute:: defaultdict.default_factory
550+
.. attribute:: default_factory
551551

552552
This attribute is used by the :meth:`__missing__` method; it is
553553
initialized from the first argument to the constructor, if present, or to
@@ -736,7 +736,7 @@ In addition to the methods inherited from tuples, named tuples support
736736
three additional methods and one attribute. To prevent conflicts with
737737
field names, the method and attribute names start with an underscore.
738738

739-
.. method:: somenamedtuple._make(iterable)
739+
.. classmethod:: somenamedtuple._make(iterable)
740740

741741
Class method that makes a new instance from an existing sequence or iterable.
742742

@@ -864,11 +864,11 @@ the items are returned in the order their keys were first added.
864864

865865
.. versionadded:: 3.1
866866

867-
.. method:: OrderedDict.popitem(last=True)
867+
.. method:: popitem(last=True)
868868

869-
The :meth:`popitem` method for ordered dictionaries returns and removes
870-
a (key, value) pair. The pairs are returned in LIFO order if *last* is
871-
true or FIFO order if false.
869+
The :meth:`popitem` method for ordered dictionaries returns and removes a
870+
(key, value) pair. The pairs are returned in LIFO order if *last* is true
871+
or FIFO order if false.
872872

873873
In addition to the usual mapping methods, ordered dictionaries also support
874874
reverse iteration using :func:`reversed`.
@@ -929,12 +929,13 @@ attribute.
929929
initialized with its contents; note that a reference to *initialdata* will not
930930
be kept, allowing it be used for other purposes.
931931

932-
In addition to supporting the methods and operations of mappings,
933-
:class:`UserDict` instances provide the following attribute:
932+
In addition to supporting the methods and operations of mappings,
933+
:class:`UserDict` instances provide the following attribute:
934934

935-
.. attribute:: UserDict.data
935+
.. attribute:: data
936936

937-
A real dictionary used to store the contents of the :class:`UserDict` class.
937+
A real dictionary used to store the contents of the :class:`UserDict`
938+
class.
938939

939940

940941

@@ -958,13 +959,13 @@ to work with because the underlying list is accessible as an attribute.
958959
defaulting to the empty list ``[]``. *list* can be any iterable, for
959960
example a real Python list or a :class:`UserList` object.
960961

961-
In addition to supporting the methods and operations of mutable sequences,
962-
:class:`UserList` instances provide the following attribute:
962+
In addition to supporting the methods and operations of mutable sequences,
963+
:class:`UserList` instances provide the following attribute:
963964

964-
.. attribute:: UserList.data
965+
.. attribute:: data
965966

966-
A real :class:`list` object used to store the contents of the
967-
:class:`UserList` class.
967+
A real :class:`list` object used to store the contents of the
968+
:class:`UserList` class.
968969

969970
**Subclassing requirements:** Subclasses of :class:`UserList` are expect to
970971
offer a constructor which can be called with either no arguments or one

0 commit comments

Comments
 (0)