]> granicus.if.org Git - python/commitdiff
Documentation for r5990[3567].
authorGeorg Brandl <georg@python.org>
Fri, 11 Jan 2008 09:55:53 +0000 (09:55 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 11 Jan 2008 09:55:53 +0000 (09:55 +0000)
Doc/glossary.rst
Doc/library/decimal.rst
Doc/library/difflib.rst
Doc/library/doctest.rst
Doc/library/inspect.rst

index fb5c01868c9b04b5b988701b9c83355df6542dc8..307bad3610c383af640919aa3342561e0da1bded 100644 (file)
@@ -338,6 +338,13 @@ Glossary
    mutable
       Mutable objects can change their value but keep their :func:`id`.  See
       also :term:`immutable`.
+
+   named tuple
+      A tuple subclass whose elements also are accessible as attributes via
+      fixed names (the class name and field names are indicated in the
+      individual documentation of a named tuple type, like ``TestResults(failed,
+      attempted)``).  Named tuple classes are created by
+      :func:`collections.namedtuple`.
     
    namespace
       The place where a variable is stored.  Namespaces are implemented as
index d8942f823e30e75ec847e0c1f31d0f8a025f19f8..eda09e47fb815482e011e5d007b7d432d7b003a6 100644 (file)
@@ -333,7 +333,11 @@ also have a number of specialized methods:
 
 .. method:: Decimal.as_tuple()
 
-   Return a tuple representation of the number: ``(sign, digit_tuple, exponent)``.
+   Return a :term:`named tuple` representation of the number:
+   ``DecimalTuple(sign, digits, exponent)``.
+
+   .. versionchanged:: 2.6
+      Use a named tuple.
 
 
 .. method:: Decimal.canonical()
index 0ae66998c65787d561c768fb05de467d9958686c..26108289b788a523a13b7acf34c19194931092c4 100644 (file)
@@ -344,7 +344,7 @@ use :meth:`set_seq2` to set the commonly used sequence once and call
 
    Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``.
 
-   If *isjunk* was omitted or ``None``, :meth:`get_longest_match` returns ``(i, j,
+   If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns ``(i, j,
    k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo <= i <= i+k <=
    ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', k')`` meeting those
    conditions, the additional conditions ``k >= k'``, ``i <= i'``, and if ``i ==
@@ -373,6 +373,9 @@ use :meth:`set_seq2` to set the commonly used sequence once and call
 
    If no blocks match, this returns ``(alo, blo, 0)``.
 
+   .. versionchanged:: 2.6
+      This method returns a :term:`named tuple` ``Match(a, b, size)``.
+
 
 .. method:: SequenceMatcher.get_matching_blocks()
 
index a231bb4c898591c15cc30879b739bc69cbb8f27f..110411f6963509cae9accf943ad3cebb954c4120 100644 (file)
@@ -1506,11 +1506,14 @@ DocTestRunner objects
 .. method:: DocTestRunner.summarize([verbose])
 
    Print a summary of all the test cases that have been run by this DocTestRunner,
-   and return a tuple ``(failure_count, test_count)``.
+   and return a :term:`named tuple` ``TestResults(failed, attempted)``.
 
    The optional *verbose* argument controls how detailed the summary is.  If the
    verbosity is not specified, then the :class:`DocTestRunner`'s verbosity is used.
 
+   .. versionchanged:: 2.6
+      Use a named tuple.
+
 
 .. _doctest-outputchecker:
 
index c1f0f009399e9994117e01953bf12f062094aeb1..7893b69246e238b70a05e797f6681834a5b97207 100644 (file)
@@ -214,6 +214,10 @@ Note:
    defined in the :mod:`imp` module; see the documentation for that module for
    more information on module types.
 
+   .. versionchanged:: 2.6
+      Returns a :term:`named tuple` ``ModuleInfo(name, suffix, mode,
+      module_type)``.
+
 
 .. function:: getmodulename(path)
 
@@ -405,6 +409,10 @@ Classes and functions
    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*.
 
+   .. versionchanged:: 2.6
+      Returns a :term:`named tuple` ``ArgSpec(args, varargs, keywords,
+      defaults)``.
+
 
 .. function:: getargvalues(frame)
 
@@ -414,6 +422,10 @@ Classes and functions
    names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals
    dictionary of the given frame.
 
+   .. versionchanged:: 2.6
+      Returns a :term:`named tuple` ``ArgInfo(args, varargs, keywords,
+      locals)``.
+
 
 .. function:: formatargspec(args[, varargs, varkw, defaults, formatarg, formatvarargs, formatvarkw, formatvalue, join])
 
@@ -479,6 +491,10 @@ line.
    Get information about a frame or traceback object.  A 5-tuple is returned, the
    last five elements of the frame's frame record.
 
+   .. versionchanged:: 2.6
+      Returns a :term:`named tuple` ``Traceback(filename, lineno, function,
+      code_context, index)``.
+
 
 .. function:: getouterframes(frame[, context])