diff options
author | Georg Brandl <georg@python.org> | 2008-03-22 22:04:10 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-22 22:04:10 (GMT) |
commit | e8f1b00372891ddf6e42886bff397c43dad7a4eb (patch) | |
tree | ed62d4d8c7055404bbfbd1382afadd443cce6944 /Doc/library/functools.rst | |
parent | 7a45ab826e9b2ecaee49cc8fd206631395a48927 (diff) | |
download | cpython-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.rst | 6 |
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): |