Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Side by Side Diff: Doc/library/collections.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/cmd.rst ('k') | Doc/library/curses.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 :mod:`collections` --- Container datatypes 2 :mod:`collections` --- Container datatypes
3 ========================================== 3 ==========================================
4 4
5 .. module:: collections 5 .. module:: collections
6 :synopsis: Container datatypes 6 :synopsis: Container datatypes
7 .. moduleauthor:: Raymond Hettinger <python@rcn.com> 7 .. moduleauthor:: Raymond Hettinger <python@rcn.com>
8 .. sectionauthor:: Raymond Hettinger <python@rcn.com> 8 .. sectionauthor:: Raymond Hettinger <python@rcn.com>
9 9
10 .. testsetup:: * 10 .. testsetup:: *
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 893
894 .. method:: move_to_end(key, last=True) 894 .. method:: move_to_end(key, last=True)
895 895
896 Move an existing *key* to either end of an ordered dictionary. The item 896 Move an existing *key* to either end of an ordered dictionary. The item
897 is moved to the right end if *last* is true (the default) or to the 897 is moved to the right end if *last* is true (the default) or to the
898 beginning if *last* is false. Raises :exc:`KeyError` if the *key* does 898 beginning if *last* is false. Raises :exc:`KeyError` if the *key* does
899 not exist:: 899 not exist::
900 900
901 >>> d = OrderedDict.fromkeys('abcde') 901 >>> d = OrderedDict.fromkeys('abcde')
902 >>> d.move_to_end('b') 902 >>> d.move_to_end('b')
903 >>> ''.join(d.keys()) 903 >>> ''.join(d.keys)
904 'acdeb' 904 'acdeb'
905 >>> d.move_to_end('b', last=False) 905 >>> d.move_to_end('b', last=False)
906 >>> ''.join(d.keys()) 906 >>> ''.join(d.keys)
907 'bacde' 907 'bacde'
908 908
909 .. versionadded:: 3.2 909 .. versionadded:: 3.2
910 910
911 In addition to the usual mapping methods, ordered dictionaries also support 911 In addition to the usual mapping methods, ordered dictionaries also support
912 reverse iteration using :func:`reversed`. 912 reverse iteration using :func:`reversed`.
913 913
914 Equality tests between :class:`OrderedDict` objects are order-sensitive 914 Equality tests between :class:`OrderedDict` objects are order-sensitive
915 and are implemented as ``list(od1.items())==list(od2.items())``. 915 and are implemented as ``list(od1.items())==list(od2.items())``.
916 Equality tests between :class:`OrderedDict` objects and other 916 Equality tests between :class:`OrderedDict` objects and other
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 1056
1057 .. class:: UserString([sequence]) 1057 .. class:: UserString([sequence])
1058 1058
1059 Class that simulates a string or a Unicode string object. The instance's 1059 Class that simulates a string or a Unicode string object. The instance's
1060 content is kept in a regular string object, which is accessible via the 1060 content is kept in a regular string object, which is accessible via the
1061 :attr:`data` attribute of :class:`UserString` instances. The instance's 1061 :attr:`data` attribute of :class:`UserString` instances. The instance's
1062 contents are initially set to a copy of *sequence*. The *sequence* can 1062 contents are initially set to a copy of *sequence*. The *sequence* can
1063 be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a 1063 be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a
1064 subclass) or an arbitrary sequence which can be converted into a string using 1064 subclass) or an arbitrary sequence which can be converted into a string using
1065 the built-in :func:`str` function. 1065 the built-in :func:`str` function.
OLDNEW
« no previous file with comments | « Doc/library/cmd.rst ('k') | Doc/library/curses.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+