Index: Doc/whatsnew/whatsnew25.tex =================================================================== --- Doc/whatsnew/whatsnew25.tex (revision 45757) +++ Doc/whatsnew/whatsnew25.tex (working copy) @@ -152,8 +152,8 @@ %====================================================================== \section{PEP 309: Partial Function Application\label{pep-309}} -The \module{functional} module is intended to contain tools for -functional-style programming. Currently it only contains a +The \module{functools} module is intended to contain tools for +manipulating function objects. Currently it only contains a \class{partial()} function, but new functions will probably be added in future versions of Python. @@ -163,7 +163,7 @@ you could create a new function \code{g(b, c)} that was equivalent to \code{f(1, b, c)}. This is called ``partial function application'', and is provided by the \class{partial} class in the new -\module{functional} module. +\module{functools} module. The constructor for \class{partial} takes the arguments \code{(\var{function}, \var{arg1}, \var{arg2}, ... @@ -174,14 +174,14 @@ Here's a small but realistic example: \begin{verbatim} -import functional +import functools def log (message, subsystem): "Write the contents of 'message' to the specified subsystem." print '%s: %s' % (subsystem, message) ... -server_log = functional.partial(log, subsystem='server') +server_log = functools.partial(log, subsystem='server') server_log('Unable to open socket') \end{verbatim} @@ -197,7 +197,7 @@ def open_item(self, path): ... def init (self): - open_func = functional.partial(self.open_item, item_path) + open_func = functools.partial(self.open_item, item_path) popup_menu.append( ("Open", open_func, 1) ) \end{verbatim}