diff options
author | Georg Brandl <georg@python.org> | 2011-01-09 08:01:46 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-01-09 08:01:46 (GMT) |
commit | 41d0815a65484aa72c37d09012bee38cfdecf393 (patch) | |
tree | 13ff9b862fb6d801c051701d82c60e5b789ee421 /Doc/library | |
parent | 1caa644ffea384c3482e3da4cb142a2610d7f470 (diff) | |
download | cpython-41d0815a65484aa72c37d09012bee38cfdecf393.zip cpython-41d0815a65484aa72c37d09012bee38cfdecf393.tar.gz cpython-41d0815a65484aa72c37d09012bee38cfdecf393.tar.bz2 |
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.
........
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/csv.rst | 2 | ||||
-rw-r--r-- | Doc/library/email.charset.rst | 16 | ||||
-rw-r--r-- | Doc/library/email.header.rst | 6 | ||||
-rw-r--r-- | Doc/library/inspect.rst | 37 | ||||
-rw-r--r-- | Doc/library/operator.rst | 3 | ||||
-rw-r--r-- | Doc/library/string.rst | 11 |
6 files changed, 34 insertions, 41 deletions
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index e75f00a..6a981a8 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -50,7 +50,7 @@ The :mod:`csv` module defines the following functions: Return a reader object which will iterate over lines in the given *csvfile*. *csvfile* can be any object which supports the :term:`iterator` protocol and returns a - string each time its :meth:`!next` method is called --- :term:`file objects + string each time its :meth:`!__next__` method is called --- :term:`file objects <file object>` and list objects are both suitable. If *csvfile* is a file object, it should be opened with ``newline=''``. [#]_ An optional *dialect* parameter can be given which is used to define a set of parameters diff --git a/Doc/library/email.charset.rst b/Doc/library/email.charset.rst index d4b06fb..1249b71 100644 --- a/Doc/library/email.charset.rst +++ b/Doc/library/email.charset.rst @@ -142,12 +142,6 @@ Import this class from the :mod:`email.charset` module. it is *input_charset*. - .. method:: encoded_header_len() - - Return the length of the encoded header string, properly calculating for - quoted-printable or base64 encoding. - - .. method:: header_encode(string) Header-encode the string *string*. @@ -156,6 +150,16 @@ Import this class from the :mod:`email.charset` module. *header_encoding* attribute. + .. method:: header_encode_lines(string, maxlengths) + + Header-encode a *string* by converting it first to bytes. + + This is similar to :meth:`header_encode` except that the string is fit + into maximum line lengths as given by the argument *maxlengths*, which + must be an iterator: each element returned from this iterator will provide + the next maximum line length. + + .. method:: body_encode(string) Body-encode the string *string*. diff --git a/Doc/library/email.header.rst b/Doc/library/email.header.rst index 796ac97..05acae7 100644 --- a/Doc/library/email.header.rst +++ b/Doc/library/email.header.rst @@ -121,14 +121,10 @@ Here is the :class:`Header` class description: .. method:: __str__() - A synonym for :meth:`Header.encode`. Useful for ``str(aHeader)``. - - - .. method:: __unicode__() - A helper for :class:`str`'s :func:`encode` method. Returns the header as a Unicode string. + .. method:: __eq__(other) This method allows you to compare two :class:`Header` instances for diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 7bb3e71..4def286 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -176,17 +176,16 @@ attributes: .. function:: getmoduleinfo(path) - Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode, - module_type)`` of values that describe how Python will interpret the file - identified by *path* if it is a module, or ``None`` if it would not be - identified as a module. The return tuple is ``(name, suffix, mode, mtype)``, - where *name* is the name of the module without the name of any enclosing - package, *suffix* is the trailing part of the file name (which may not be a - dot-delimited extension), *mode* is the :func:`open` mode that would be used - (``'r'`` or ``'rb'``), and *mtype* is an integer giving the type of the - module. *mtype* will have a value which can be compared to the constants - defined in the :mod:`imp` module; see the documentation for that module for - more information on module types. + Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode, module_type)`` + of values that describe how Python will interpret the file identified by + *path* if it is a module, or ``None`` if it would not be identified as a + module. In that tuple, *name* is the name of the module without the name of + any enclosing package, *suffix* is the trailing part of the file name (which + may not be a dot-delimited extension), *mode* is the :func:`open` mode that + would be used (``'r'`` or ``'rb'``), and *module_type* is an integer giving + the type of the module. *module_type* will have a value which can be + compared to the constants defined in the :mod:`imp` module; see the + documentation for that module for more information on module types. .. function:: getmodulename(path) @@ -391,12 +390,12 @@ Classes and functions .. function:: getargspec(func) Get the names and default values of a Python function's arguments. A - :term:`named tuple` ``ArgSpec(args, varargs, keywords, - defaults)`` is returned. *args* is a list of - the argument names. *varargs* and *varkw* are the names of the ``*`` and - ``**`` arguments or ``None``. *defaults* is a tuple of default argument - values or None if there are no default arguments; if this tuple has *n* - elements, they correspond to the last *n* elements listed in *args*. + :term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is + returned. *args* is a list of the argument names. *varargs* and *keywords* + are the names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a + tuple of default argument values or None if there are no default arguments; + if this tuple has *n* elements, they correspond to the last *n* elements + listed in *args*. .. deprecated:: 3.0 Use :func:`getfullargspec` instead, which provides information about @@ -425,8 +424,8 @@ Classes and functions Get information about arguments passed into a particular frame. A :term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is - returned. *args* is a list of the argument names. *varargs* and *varkw* are - the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the + returned. *args* is a list of the argument names. *varargs* and *keywords* + are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals dictionary of the given frame. diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 2d03061..43bdeef 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -19,8 +19,7 @@ names are those used for special class methods; variants without leading and trailing ``__`` are also provided for convenience. The functions fall into categories that perform object comparisons, logical -operations, mathematical operations, sequence operations, and abstract type -tests. +operations, mathematical operations and sequence operations. The object comparison functions are useful for all objects, and are named after the rich comparison operators they support: diff --git a/Doc/library/string.rst b/Doc/library/string.rst index a5d11de..5696e91 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -5,16 +5,11 @@ :synopsis: Common string operations. -.. index:: module: re +.. seealso:: -The :mod:`string` module contains a number of useful constants and classes -for string formatting. In addition, Python's built-in string classes -support the sequence type methods described in the :ref:`typesseq` -section, and also the string-specific methods described in the -:ref:`string-methods` section. To output formatted strings, see the -:ref:`string-formatting` section. Also, see the :mod:`re` module for -string functions based on regular expressions. + :ref:`typesseq` + :ref:`string-methods` String constants ---------------- |