blob: 5aa30e36f140322a6c0b23db11b29d530ff4e6cb [file] [log] [blame]
Nick Coghlan08490142006-05-29 20:27:44 +00001"""functools.py - Tools for working with functions
2"""
3# Python module wrapper for _functools C module
4# to allow utilities written in Python to be added
5# to the functools module.
6# Written by Nick Coghlan <ncoghlan at gmail.com>
7# Copyright (c) 2006 Python Software Foundation.
8
9from _functools import partial
10__all__ = [
11 "partial",
12]
13
14# Still to come here (need to write tests and docs):
15# update_wrapper - utility function to transfer basic function
16# metadata to wrapper functions
17# WRAPPER_ASSIGNMENTS & WRAPPER_UPDATES - defaults args to above
18# (update_wrapper has been approved by BDFL)
19# wraps - decorator factory equivalent to:
20# def wraps(f):
21# return partial(update_wrapper, wrapped=f)
22#
23# The wraps function makes it easy to avoid the bug that afflicts the
24# decorator example in the python-dev email proposing the
25# update_wrapper function:
26# http://mail.python.org/pipermail/python-dev/2006-May/064775.html