summaryrefslogtreecommitdiffstats
path: root/Lib/functools.py
blob: 4935c9f68e8f47d4df7f82a61afb4a039163d8bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""functools.py - Tools for working with functions
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
#   Copyright (c) 2006 Python Software Foundation.

from _functools import partial
__all__ = [
    "partial",
]

# Still to come here (need to write tests and docs):
#   update_wrapper - utility function to transfer basic function
#                    metadata to wrapper functions
#   WRAPPER_ASSIGNMENTS & WRAPPER_UPDATES - defaults args to above
#           (update_wrapper has been approved by BDFL)
#   wraps - decorator factory equivalent to:
#               def wraps(f):
#                     return partial(update_wrapper, wrapped=f)
#
# The wraps function makes it easy to avoid the bug that afflicts the
# decorator example in the python-dev email proposing the
# update_wrapper function:
# http://mail.python.org/pipermail/python-dev/2006-May/064775.html