summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2006-05-29 12:43:05 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2006-05-29 12:43:05 (GMT)
commitc649ec5b69bd864914e02a2a9ec73c23bd307448 (patch)
tree795bb943ec4b6a13501e55aaa6a8efe9b86d0305 /Modules
parentc7c51147c73984137410ec03026b77e4a76ab61e (diff)
downloadcpython-c649ec5b69bd864914e02a2a9ec73c23bd307448.zip
cpython-c649ec5b69bd864914e02a2a9ec73c23bd307448.tar.gz
cpython-c649ec5b69bd864914e02a2a9ec73c23bd307448.tar.bz2
Apply modified version of Collin Winter's patch #1478788
Renames functional extension module to _functools and adds a Python functools module so that utility functions like update_wrapper can be added easily.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_functoolsmodule.c (renamed from Modules/functionalmodule.c)12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/functionalmodule.c b/Modules/_functoolsmodule.c
index 38ef43a..54abb89 100644
--- a/Modules/functionalmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -2,10 +2,10 @@
#include "Python.h"
#include "structmember.h"
-/* Functional module written and maintained
+/* _functools module written and maintained
by Hye-Shik Chang <perky@FreeBSD.org>
with adaptations by Raymond Hettinger <python@rcn.com>
- Copyright (c) 2004, 2005 Python Software Foundation.
+ Copyright (c) 2004, 2005, 2006 Python Software Foundation.
All rights reserved.
*/
@@ -199,7 +199,7 @@ static PyGetSetDef partial_getsetlist[] = {
static PyTypeObject partial_type = {
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
- "functional.partial", /* tp_name */
+ "functools.partial", /* tp_name */
sizeof(partialobject), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
@@ -245,14 +245,14 @@ static PyTypeObject partial_type = {
/* module level code ********************************************************/
PyDoc_STRVAR(module_doc,
-"Tools for functional programming.");
+"Tools that operate on functions.");
static PyMethodDef module_methods[] = {
{NULL, NULL} /* sentinel */
};
PyMODINIT_FUNC
-initfunctional(void)
+init_functools(void)
{
int i;
PyObject *m;
@@ -262,7 +262,7 @@ initfunctional(void)
NULL
};
- m = Py_InitModule3("functional", module_methods, module_doc);
+ m = Py_InitModule3("_functools", module_methods, module_doc);
if (m == NULL)
return;