Skip to content

Commit 41d0815

Browse files
committed
Merged revisions 87789-87790 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r87789 | georg.brandl | 2011-01-06 10:23:56 +0100 (Do, 06 Jan 2011) | 1 line Fix various issues (mostly Python 2 relics) found by Jacques Ducasse. ........ r87790 | georg.brandl | 2011-01-06 10:25:27 +0100 (Do, 06 Jan 2011) | 1 line Add acks where acks are due. ........
1 parent 1caa644 commit 41d0815

File tree

10 files changed

+48
-55
lines changed

10 files changed

+48
-55
lines changed

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ docs@python.org), and we'll be glad to correct the problem.
4747
* L. Peter Deutsch
4848
* Robert Donohue
4949
* Fred L. Drake, Jr.
50+
* Jacques Ducasse
5051
* Josip Dzolonga
5152
* Jeff Epler
5253
* Michael Ernst

Doc/glossary.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,12 @@ Glossary
344344

345345
iterator
346346
An object representing a stream of data. Repeated calls to the iterator's
347-
:meth:`__next__` (or passing it to the built-in function :func:`next`)
348-
method return successive items in the stream. When no more data are
349-
available a :exc:`StopIteration` exception is raised instead. At this
347+
:meth:`__next__` method (or passing it to the built-in function
348+
:func:`next`) return successive items in the stream. When no more data
349+
are available a :exc:`StopIteration` exception is raised instead. At this
350350
point, the iterator object is exhausted and any further calls to its
351-
:meth:`next` method just raise :exc:`StopIteration` again. Iterators are
352-
required to have an :meth:`__iter__` method that returns the iterator
351+
:meth:`__next__` method just raise :exc:`StopIteration` again. Iterators
352+
are required to have an :meth:`__iter__` method that returns the iterator
353353
object itself so every iterator is also iterable and may be used in most
354354
places where other iterables are accepted. One notable exception is code
355355
which attempts multiple iteration passes. A container object (such as a

Doc/library/csv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The :mod:`csv` module defines the following functions:
5050

5151
Return a reader object which will iterate over lines in the given *csvfile*.
5252
*csvfile* can be any object which supports the :term:`iterator` protocol and returns a
53-
string each time its :meth:`!next` method is called --- :term:`file objects
53+
string each time its :meth:`!__next__` method is called --- :term:`file objects
5454
<file object>` and list objects are both suitable. If *csvfile* is a file object,
5555
it should be opened with ``newline=''``. [#]_ An optional
5656
*dialect* parameter can be given which is used to define a set of parameters

Doc/library/email.charset.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ Import this class from the :mod:`email.charset` module.
142142
it is *input_charset*.
143143

144144

145-
.. method:: encoded_header_len()
146-
147-
Return the length of the encoded header string, properly calculating for
148-
quoted-printable or base64 encoding.
149-
150-
151145
.. method:: header_encode(string)
152146

153147
Header-encode the string *string*.
@@ -156,6 +150,16 @@ Import this class from the :mod:`email.charset` module.
156150
*header_encoding* attribute.
157151

158152

153+
.. method:: header_encode_lines(string, maxlengths)
154+
155+
Header-encode a *string* by converting it first to bytes.
156+
157+
This is similar to :meth:`header_encode` except that the string is fit
158+
into maximum line lengths as given by the argument *maxlengths*, which
159+
must be an iterator: each element returned from this iterator will provide
160+
the next maximum line length.
161+
162+
159163
.. method:: body_encode(string)
160164

161165
Body-encode the string *string*.

Doc/library/email.header.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,10 @@ Here is the :class:`Header` class description:
121121

122122
.. method:: __str__()
123123

124-
A synonym for :meth:`Header.encode`. Useful for ``str(aHeader)``.
125-
126-
127-
.. method:: __unicode__()
128-
129124
A helper for :class:`str`'s :func:`encode` method. Returns the header as
130125
a Unicode string.
131126

127+
132128
.. method:: __eq__(other)
133129

134130
This method allows you to compare two :class:`Header` instances for

Doc/library/inspect.rst

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,16 @@ attributes:
176176

177177
.. function:: getmoduleinfo(path)
178178

179-
Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode,
180-
module_type)`` of values that describe how Python will interpret the file
181-
identified by *path* if it is a module, or ``None`` if it would not be
182-
identified as a module. The return tuple is ``(name, suffix, mode, mtype)``,
183-
where *name* is the name of the module without the name of any enclosing
184-
package, *suffix* is the trailing part of the file name (which may not be a
185-
dot-delimited extension), *mode* is the :func:`open` mode that would be used
186-
(``'r'`` or ``'rb'``), and *mtype* is an integer giving the type of the
187-
module. *mtype* will have a value which can be compared to the constants
188-
defined in the :mod:`imp` module; see the documentation for that module for
189-
more information on module types.
179+
Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode, module_type)``
180+
of values that describe how Python will interpret the file identified by
181+
*path* if it is a module, or ``None`` if it would not be identified as a
182+
module. In that tuple, *name* is the name of the module without the name of
183+
any enclosing package, *suffix* is the trailing part of the file name (which
184+
may not be a dot-delimited extension), *mode* is the :func:`open` mode that
185+
would be used (``'r'`` or ``'rb'``), and *module_type* is an integer giving
186+
the type of the module. *module_type* will have a value which can be
187+
compared to the constants defined in the :mod:`imp` module; see the
188+
documentation for that module for more information on module types.
190189

191190

192191
.. function:: getmodulename(path)
@@ -391,12 +390,12 @@ Classes and functions
391390
.. function:: getargspec(func)
392391

393392
Get the names and default values of a Python function's arguments. A
394-
:term:`named tuple` ``ArgSpec(args, varargs, keywords,
395-
defaults)`` is returned. *args* is a list of
396-
the argument names. *varargs* and *varkw* are the names of the ``*`` and
397-
``**`` arguments or ``None``. *defaults* is a tuple of default argument
398-
values or None if there are no default arguments; if this tuple has *n*
399-
elements, they correspond to the last *n* elements listed in *args*.
393+
:term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is
394+
returned. *args* is a list of the argument names. *varargs* and *keywords*
395+
are the names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a
396+
tuple of default argument values or None if there are no default arguments;
397+
if this tuple has *n* elements, they correspond to the last *n* elements
398+
listed in *args*.
400399

401400
.. deprecated:: 3.0
402401
Use :func:`getfullargspec` instead, which provides information about
@@ -425,8 +424,8 @@ Classes and functions
425424

426425
Get information about arguments passed into a particular frame. A
427426
:term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is
428-
returned. *args* is a list of the argument names. *varargs* and *varkw* are
429-
the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the
427+
returned. *args* is a list of the argument names. *varargs* and *keywords*
428+
are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the
430429
locals dictionary of the given frame.
431430

432431

Doc/library/operator.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ names are those used for special class methods; variants without leading and
1919
trailing ``__`` are also provided for convenience.
2020

2121
The functions fall into categories that perform object comparisons, logical
22-
operations, mathematical operations, sequence operations, and abstract type
23-
tests.
22+
operations, mathematical operations and sequence operations.
2423

2524
The object comparison functions are useful for all objects, and are named after
2625
the rich comparison operators they support:

Doc/library/string.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
:synopsis: Common string operations.
66

77

8-
.. index:: module: re
8+
.. seealso::
99

10-
The :mod:`string` module contains a number of useful constants and classes
11-
for string formatting. In addition, Python's built-in string classes
12-
support the sequence type methods described in the :ref:`typesseq`
13-
section, and also the string-specific methods described in the
14-
:ref:`string-methods` section. To output formatted strings, see the
15-
:ref:`string-formatting` section. Also, see the :mod:`re` module for
16-
string functions based on regular expressions.
10+
:ref:`typesseq`
1711

12+
:ref:`string-methods`
1813

1914
String constants
2015
----------------

Doc/reference/compound_stmts.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,11 @@ keeping all locals in that frame alive until the next garbage collection occurs.
285285

286286
Before an except clause's suite is executed, details about the exception are
287287
stored in the :mod:`sys` module and can be access via :func:`sys.exc_info`.
288-
:func:`sys.exc_info` returns a 3-tuple consisting of: ``exc_type``, the
289-
exception class; ``exc_value``, the exception instance; ``exc_traceback``, a
290-
traceback object (see section :ref:`types`) identifying the point in the program
291-
where the exception occurred. :func:`sys.exc_info` values are restored to their
292-
previous values (before the call) when returning from a function that handled an
293-
exception.
288+
:func:`sys.exc_info` returns a 3-tuple consisting of the exception class, the
289+
exception instance and a traceback object (see section :ref:`types`) identifying
290+
the point in the program where the exception occurred. :func:`sys.exc_info`
291+
values are restored to their previous values (before the call) when returning
292+
from a function that handled an exception.
294293

295294
.. index::
296295
keyword: else

Doc/reference/executionmodel.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ weak form of restricted execution.
141141
The namespace for a module is automatically created the first time a module is
142142
imported. The main module for a script is always called :mod:`__main__`.
143143

144-
The global statement has the same scope as a name binding operation in the same
145-
block. If the nearest enclosing scope for a free variable contains a global
146-
statement, the free variable is treated as a global.
144+
The :keyword:`global` statement has the same scope as a name binding operation
145+
in the same block. If the nearest enclosing scope for a free variable contains
146+
a global statement, the free variable is treated as a global.
147147

148148
A class definition is an executable statement that may use and define names.
149149
These references follow the normal rules for name resolution. The namespace of

0 commit comments

Comments
 (0)