Skip to content

Commit 4aef703

Browse files
committed
Merged revisions 66801,66803-66804,66813,66854-66856,66866,66870-66872,66874,66887,66903,66905,66911,66913,66927,66932,66938,66942,66962,66964,66973-66974,66977,66992,66998-66999,67002,67005,67007,67028,67040-67041,67044,67070,67089,67091,67101,67117-67119,67123-67124 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ................ r66801 | andrew.kuchling | 2008-10-04 23:51:59 +0200 (Sat, 04 Oct 2008) | 1 line Punctuation fix; expand dict.update docstring to be clearer ................ r66803 | benjamin.peterson | 2008-10-05 00:15:31 +0200 (Sun, 05 Oct 2008) | 1 line fix typo ................ r66804 | andrew.kuchling | 2008-10-05 02:11:56 +0200 (Sun, 05 Oct 2008) | 1 line #1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args() ................ r66813 | andrew.kuchling | 2008-10-06 14:07:04 +0200 (Mon, 06 Oct 2008) | 3 lines Per Greg Ward, optparse is no longer being externally maintained. I'll look at the bugs in the Optik bug tracker and copy them to the Python bug tracker if they're still relevant. ................ r66854 | georg.brandl | 2008-10-08 19:20:20 +0200 (Wed, 08 Oct 2008) | 2 lines #4059: patch up some sqlite docs. ................ r66855 | georg.brandl | 2008-10-08 19:30:55 +0200 (Wed, 08 Oct 2008) | 2 lines #4058: fix some whatsnew markup. ................ r66856 | georg.brandl | 2008-10-08 20:47:17 +0200 (Wed, 08 Oct 2008) | 3 lines #3935: properly support list subclasses in the C impl. of bisect. Patch reviewed by Raymond. ................ r66866 | benjamin.peterson | 2008-10-09 22:54:43 +0200 (Thu, 09 Oct 2008) | 1 line update paragraph about __future__ for 2.6 ................ r66870 | armin.rigo | 2008-10-10 10:40:44 +0200 (Fri, 10 Oct 2008) | 2 lines Typo: "ThreadError" is the name in the C source. ................ r66871 | benjamin.peterson | 2008-10-10 22:38:49 +0200 (Fri, 10 Oct 2008) | 1 line fix a small typo ................ r66872 | benjamin.peterson | 2008-10-10 22:51:37 +0200 (Fri, 10 Oct 2008) | 1 line talk about how you can unzip with zip ................ r66874 | benjamin.peterson | 2008-10-11 00:23:41 +0200 (Sat, 11 Oct 2008) | 1 line PyGILState_Acquire -> PyGILState_Ensure ................ r66887 | benjamin.peterson | 2008-10-13 23:51:40 +0200 (Mon, 13 Oct 2008) | 1 line document how to disable fixers ................ r66903 | benjamin.peterson | 2008-10-15 22:34:09 +0200 (Wed, 15 Oct 2008) | 1 line don't recurse into directories that start with '.' ................ r66905 | benjamin.peterson | 2008-10-15 23:05:55 +0200 (Wed, 15 Oct 2008) | 1 line support the optional line argument for idle ................ r66911 | benjamin.peterson | 2008-10-16 01:10:28 +0200 (Thu, 16 Oct 2008) | 41 lines Merged revisions 66805,66841,66860,66884-66886,66893,66907,66910 via svnmerge from svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r66805 | benjamin.peterson | 2008-10-04 20:11:02 -0500 (Sat, 04 Oct 2008) | 1 line mention what the fixes directory is for ........ r66841 | benjamin.peterson | 2008-10-07 17:48:12 -0500 (Tue, 07 Oct 2008) | 1 line use assertFalse and assertTrue ........ r66860 | benjamin.peterson | 2008-10-08 16:05:07 -0500 (Wed, 08 Oct 2008) | 1 line instead of abusing the pattern matcher, use start_tree to find a next binding ........ r66884 | benjamin.peterson | 2008-10-13 15:50:30 -0500 (Mon, 13 Oct 2008) | 1 line don't print tokens to stdout when -v is given ........ r66885 | benjamin.peterson | 2008-10-13 16:28:57 -0500 (Mon, 13 Oct 2008) | 1 line add the -x option to disable fixers ........ r66886 | benjamin.peterson | 2008-10-13 16:33:53 -0500 (Mon, 13 Oct 2008) | 1 line cut down on some crud ........ r66893 | benjamin.peterson | 2008-10-14 17:16:54 -0500 (Tue, 14 Oct 2008) | 1 line add an optional set literal fixer ........ r66907 | benjamin.peterson | 2008-10-15 16:59:41 -0500 (Wed, 15 Oct 2008) | 1 line don't write backup files by default ........ r66910 | benjamin.peterson | 2008-10-15 17:43:10 -0500 (Wed, 15 Oct 2008) | 1 line add the -n option; it stops backupfiles from being written ........ ................ r66913 | benjamin.peterson | 2008-10-16 20:52:14 +0200 (Thu, 16 Oct 2008) | 1 line document that deque indexing is O(n) #4123 ................ r66927 | andrew.kuchling | 2008-10-16 22:15:47 +0200 (Thu, 16 Oct 2008) | 1 line Fix wording (2.6.1 backport candidate) ................ r66932 | benjamin.peterson | 2008-10-16 23:09:28 +0200 (Thu, 16 Oct 2008) | 1 line check for error conditions in _json #3623 ................ r66938 | benjamin.peterson | 2008-10-16 23:27:54 +0200 (Thu, 16 Oct 2008) | 1 line fix possible ref leak ................ r66942 | benjamin.peterson | 2008-10-16 23:48:06 +0200 (Thu, 16 Oct 2008) | 1 line fix more possible ref leaks in _json and use Py_CLEAR ................ r66962 | benjamin.peterson | 2008-10-17 22:01:01 +0200 (Fri, 17 Oct 2008) | 1 line clarify CALL_FUNCTION #4141 ................ r66964 | georg.brandl | 2008-10-17 23:41:49 +0200 (Fri, 17 Oct 2008) | 2 lines Fix duplicate word. ................ r66973 | armin.ronacher | 2008-10-19 10:27:43 +0200 (Sun, 19 Oct 2008) | 3 lines Fixed #4067 by implementing _attributes and _fields for the AST root node. ................ r66974 | benjamin.peterson | 2008-10-19 15:59:01 +0200 (Sun, 19 Oct 2008) | 1 line fix compiler warning ................ r66977 | benjamin.peterson | 2008-10-19 21:39:16 +0200 (Sun, 19 Oct 2008) | 1 line mention -n ................ r66992 | benjamin.peterson | 2008-10-21 22:51:13 +0200 (Tue, 21 Oct 2008) | 1 line make sure to call iteritems() ................ r66998 | benjamin.peterson | 2008-10-22 22:57:43 +0200 (Wed, 22 Oct 2008) | 1 line fix a few typos ................ r66999 | benjamin.peterson | 2008-10-22 23:05:30 +0200 (Wed, 22 Oct 2008) | 1 line and another typo... ................ r67002 | hirokazu.yamamoto | 2008-10-23 02:37:33 +0200 (Thu, 23 Oct 2008) | 1 line Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL. ................ r67005 | walter.doerwald | 2008-10-23 15:11:39 +0200 (Thu, 23 Oct 2008) | 2 lines Use the correct names of the stateless codec functions (Fixes issue 4178). ................ r67007 | benjamin.peterson | 2008-10-23 23:43:48 +0200 (Thu, 23 Oct 2008) | 1 line only nonempty __slots__ don't work ................ r67028 | benjamin.peterson | 2008-10-26 01:27:07 +0200 (Sun, 26 Oct 2008) | 1 line don't use a catch-all ................ r67040 | armin.rigo | 2008-10-28 18:01:21 +0100 (Tue, 28 Oct 2008) | 5 lines Fix one of the tests: it relied on being present in an "output test" in order to actually test what it was supposed to test, i.e. that the code in the __del__ method did not crash. Use instead the new helper test_support.captured_output(). ................ r67041 | benjamin.peterson | 2008-10-29 21:33:00 +0100 (Wed, 29 Oct 2008) | 1 line mention the version gettempdir() was added ................ r67044 | amaury.forgeotdarc | 2008-10-30 00:15:57 +0100 (Thu, 30 Oct 2008) | 3 lines Correct error message in io.open(): closefd=True is the only accepted value with a file name. ................ r67070 | benjamin.peterson | 2008-10-31 21:41:44 +0100 (Fri, 31 Oct 2008) | 1 line rephrase has_key doc ................ r67089 | benjamin.peterson | 2008-11-03 21:43:20 +0100 (Mon, 03 Nov 2008) | 1 line clarify by splitting into multiple paragraphs ................ r67091 | benjamin.peterson | 2008-11-03 23:34:57 +0100 (Mon, 03 Nov 2008) | 1 line move a FileIO test to test_fileio ................ r67101 | georg.brandl | 2008-11-04 21:49:35 +0100 (Tue, 04 Nov 2008) | 2 lines #4167: fix markup glitches. ................ r67117 | georg.brandl | 2008-11-06 11:17:58 +0100 (Thu, 06 Nov 2008) | 2 lines #4268: Use correct module for two toplevel functions. ................ r67118 | georg.brandl | 2008-11-06 11:19:11 +0100 (Thu, 06 Nov 2008) | 2 lines #4267: small fixes in sqlite3 docs. ................ r67119 | georg.brandl | 2008-11-06 11:20:49 +0100 (Thu, 06 Nov 2008) | 2 lines #4245: move Thread section to the top. ................ r67123 | georg.brandl | 2008-11-06 19:49:15 +0100 (Thu, 06 Nov 2008) | 2 lines #4247: add "pass" examples to tutorial. ................ r67124 | andrew.kuchling | 2008-11-06 20:23:02 +0100 (Thu, 06 Nov 2008) | 1 line Fix grammar error; reword two paragraphs ................
1 parent 939582f commit 4aef703

48 files changed

Lines changed: 941 additions & 541 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/ACKS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ docs@python.org), and we'll be glad to correct the problem.
1616
* A. Amoroso
1717
* Pehr Anderson
1818
* Oliver Andrich
19+
* Heidi Annexstad
1920
* Jesús Cea Avión
2021
* Daniel Barclay
2122
* Chris Barker
@@ -189,6 +190,7 @@ docs@python.org), and we'll be glad to correct the problem.
189190
* Reuben Sumner
190191
* Kalle Svensson
191192
* Jim Tittsler
193+
* David Turner
192194
* Ville Vainio
193195
* Martijn Vries
194196
* Charles G. Waldman

Doc/c-api/init.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,11 @@ created.
755755
:cmacro:`Py_END_ALLOW_THREADS` macros is acceptable.
756756

757757
The return value is an opaque "handle" to the thread state when
758-
:cfunc:`PyGILState_Acquire` was called, and must be passed to
758+
:cfunc:`PyGILState_Ensure` was called, and must be passed to
759759
:cfunc:`PyGILState_Release` to ensure Python is left in the same state. Even
760760
though recursive calls are allowed, these handles *cannot* be shared - each
761-
unique call to :cfunc:`PyGILState_Ensure` must save the handle for its call to
762-
:cfunc:`PyGILState_Release`.
761+
unique call to :cfunc:`PyGILState_Ensure` must save the handle for its call
762+
to :cfunc:`PyGILState_Release`.
763763

764764
When the function returns, the current thread will hold the GIL. Failure is a
765765
fatal error.

Doc/library/2to3.rst

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ It can be converted to Python 3.x code via 2to3 on the command line::
3737

3838
A diff against the original source file is printed. 2to3 can also write the
3939
needed modifications right back to the source file. (Of course, a backup of the
40-
original is also be made.) Writing the changes back is enabled with the
41-
:option:`-w` flag::
40+
original is also be made unless :option:`-n` is also given.) Writing the
41+
changes back is enabled with the :option:`-w` flag::
4242

4343
$ 2to3 -w example.py
4444

@@ -50,16 +50,19 @@ After transformation, :file:`example.py` looks like this::
5050
name = input()
5151
greet(name)
5252

53-
Comments and and exact indentation are preserved throughout the translation
54-
process.
53+
Comments and exact indentation are preserved throughout the translation process.
5554

5655
By default, 2to3 runs a set of predefined fixers. The :option:`-l` flag lists
57-
all available fixers. An explicit set of fixers to run can be given by use of
58-
the :option:`-f` flag. The following example runs only the ``imports`` and
59-
``has_key`` fixers::
56+
all available fixers. An explicit set of fixers to run can be given with
57+
:option:`-f`. Likewise the :option:`-x` explicitly disables a fixer. The
58+
following example runs only the ``imports`` and ``has_key`` fixers::
6059

6160
$ 2to3 -f imports -f has_key example.py
6261

62+
This command runs every fixer except the ``apply`` fixer::
63+
64+
$ 2to3 -x apply example.py
65+
6366
Some fixers are *explicit*, meaning they aren't run by default and must be
6467
listed on the command line to be run. Here, in addition to the default fixers,
6568
the ``idioms`` fixer is run::
@@ -68,25 +71,25 @@ the ``idioms`` fixer is run::
6871

6972
Notice how passing ``all`` enables all default fixers.
7073

71-
Sometimes 2to3 will find a place in your source code that needs to be
72-
changed, but 2to3 cannot fix automatically. In this case, 2to3 will print a
73-
warning beneath the diff for a file. You should address the warning in order to
74-
have compliant 3.x code.
74+
Sometimes 2to3 will find a place in your source code that needs to be changed,
75+
but 2to3 cannot fix automatically. In this case, 2to3 will print a warning
76+
beneath the diff for a file. You should address the warning in order to have
77+
compliant 3.x code.
7578

7679
2to3 can also refactor doctests. To enable this mode, use the :option:`-d`
7780
flag. Note that *only* doctests will be refactored. This also doesn't require
7881
the module to be valid Python. For example, doctest like examples in a reST
7982
document could also be refactored with this option.
8083

81-
The :option:`-v` option enables the output of more information on the
82-
translation process.
84+
The :option:`-v` option enables output of more information on the translation
85+
process.
8386

84-
When the :option:`-p` is passed, 2to3 treats ``print`` as a function instead
85-
of a statement. This is useful when ``from __future__ import print_function``
86-
is being used. If this option is not given, the print fixer will surround
87-
print calls in an extra set of parentheses because it cannot differentiate
88-
between the print statement with parentheses (such as ``print ("a" + "b" +
89-
"c")``) and a true function call.
87+
When the :option:`-p` is passed, 2to3 treats ``print`` as a function instead of
88+
a statement. This is useful when ``from __future__ import print_function`` is
89+
being used. If this option is not given, the print fixer will surround print
90+
calls in an extra set of parentheses because it cannot differentiate between the
91+
print statement with parentheses (such as ``print ("a" + "b" + "c")``) and a
92+
true function call.
9093

9194

9295
:mod:`lib2to3` - 2to3's library

Doc/library/codecs.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ It defines the following functions:
3232

3333
* ``name`` The name of the encoding;
3434

35-
* ``encoder`` The stateless encoding function;
35+
* ``encode`` The stateless encoding function;
3636

37-
* ``decoder`` The stateless decoding function;
37+
* ``decode`` The stateless decoding function;
3838

3939
* ``incrementalencoder`` An incremental encoder class or factory function;
4040

@@ -46,7 +46,7 @@ It defines the following functions:
4646

4747
The various functions or classes take the following arguments:
4848

49-
*encoder* and *decoder*: These must be functions or methods which have the same
49+
*encode* and *decode*: These must be functions or methods which have the same
5050
interface as the :meth:`encode`/:meth:`decode` methods of Codec instances (see
5151
Codec Interface). The functions/methods are expected to work in a stateless
5252
mode.

Doc/library/collections.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
247247

248248
In addition to the above, deques support iteration, pickling, ``len(d)``,
249249
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
250-
the :keyword:`in` operator, and subscript references such as ``d[-1]``.
250+
the :keyword:`in` operator, and subscript references such as ``d[-1]``. Indexed
251+
access is O(1) at both ends but slows to O(n) in the middle. For fast random
252+
access, use lists instead.
251253

252254
Example:
253255

Doc/library/dis.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,8 @@ the more significant byte last.
755755
opcode finds the keyword parameters first. For each keyword argument, the value
756756
is on top of the key. Below the keyword parameters, the positional parameters
757757
are on the stack, with the right-most parameter on top. Below the parameters,
758-
the function object to call is on the stack.
758+
the function object to call is on the stack. Pops all function arguments, and
759+
the function itself off the stack, and pushes the return value.
759760

760761

761762
.. opcode:: MAKE_FUNCTION (argc)

Doc/library/email.parser.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ Since creating a message object structure from a string or a file object is such
159159
a common task, two functions are provided as a convenience. They are available
160160
in the top-level :mod:`email` package namespace.
161161

162+
.. currentmodule:: email
162163

163164
.. function:: message_from_string(s[, _class[, strict]])
164165

Doc/library/ftplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
315315
.. method:: FTP.quit()
316316

317317
Send a ``QUIT`` command to the server and close the connection. This is the
318-
"polite" way to close a connection, but it may raise an exception of the server
318+
"polite" way to close a connection, but it may raise an exception if the server
319319
responds with an error to the ``QUIT`` command. This implies a call to the
320320
:meth:`close` method which renders the :class:`FTP` instance useless for
321321
subsequent calls (see below).

Doc/library/functions.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,18 @@ available. They are listed here in alphabetical order.
13971397
makes possible an idiom for clustering a data series into n-length groups
13981398
using ``zip(*[iter(s)]*n)``.
13991399

1400+
:func:`zip` in conjunction with the ``*`` operator can be used to unzip a
1401+
list::
1402+
1403+
>>> x = [1, 2, 3]
1404+
>>> y = [4, 5, 6]
1405+
>>> zipped = zip(x, y)
1406+
>>> zipped
1407+
[(1, 4), (2, 5), (3, 6)]
1408+
>>> x2, y2 = zip(*zipped)
1409+
>>> x == x2, y == y2
1410+
True
1411+
14001412
.. versionadded:: 2.0
14011413

14021414
.. versionchanged:: 2.4

Doc/library/heapq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The module also offers three general purpose functions based on heaps.
9595

9696
Merge multiple sorted inputs into a single sorted output (for example, merge
9797
timestamped entries from multiple log files). Returns an :term:`iterator`
98-
over over the sorted values.
98+
over the sorted values.
9999

100100
Similar to ``sorted(itertools.chain(*iterables))`` but returns an iterable, does
101101
not pull the data into memory all at once, and assumes that each of the input

0 commit comments

Comments
 (0)