diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2006-05-29 20:27:44 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-05-29 20:27:44 (GMT) |
commit | 08490146df70ef8c98f9c828ea861c661761b09e (patch) | |
tree | f9d6f16b8d3e2b5f02f04a0d4f128e1e966a9db1 /Lib/functools.py | |
parent | 2cfaa34dfa2919803a7caf7cfd99aa21d6c40e06 (diff) | |
download | cpython-08490146df70ef8c98f9c828ea861c661761b09e.zip cpython-08490146df70ef8c98f9c828ea861c661761b09e.tar.gz cpython-08490146df70ef8c98f9c828ea861c661761b09e.tar.bz2 |
When adding a module like functools, it helps to let SVN know about the file.
Diffstat (limited to 'Lib/functools.py')
-rw-r--r-- | Lib/functools.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/functools.py b/Lib/functools.py new file mode 100644 index 0000000..5aa30e3 --- /dev/null +++ b/Lib/functools.py @@ -0,0 +1,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
\ No newline at end of file |