summaryrefslogtreecommitdiffstats
path: root/Doc/library/functools.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-22 22:04:10 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-22 22:04:10 (GMT)
commite8f1b00372891ddf6e42886bff397c43dad7a4eb (patch)
treeed62d4d8c7055404bbfbd1382afadd443cce6944 /Doc/library/functools.rst
parent7a45ab826e9b2ecaee49cc8fd206631395a48927 (diff)
downloadcpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.zip
cpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.tar.gz
cpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.tar.bz2
Enable doctest running for several other documents.
We have now over 640 doctests that are run with "make doctest".
Diffstat (limited to 'Doc/library/functools.rst')
-rw-r--r--Doc/library/functools.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 0f94848..a09d3cf 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -48,8 +48,9 @@ The :mod:`functools` module defines the following functions:
some portion of a function's arguments and/or keywords resulting in a new object
with a simplified signature. For example, :func:`partial` can be used to create
a callable that behaves like the :func:`int` function where the *base* argument
- defaults to two::
+ defaults to two:
+ >>> from functools import partial
>>> basetwo = partial(int, base=2)
>>> basetwo.__doc__ = 'Convert base 2 string to an int.'
>>> basetwo('10010')
@@ -79,8 +80,9 @@ The :mod:`functools` module defines the following functions:
This is a convenience function for invoking ``partial(update_wrapper,
wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator
- when defining a wrapper function. For example::
+ when defining a wrapper function. For example:
+ >>> from functools import wraps
>>> def my_decorator(f):
... @wraps(f)
... def wrapper(*args, **kwds):