functools
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py
Module Docs

functools.py - Tools for working with functions and callable objects

 
Classes
       
__builtin__.object
partial

 
class partial(__builtin__.object)
    partial(func, *args, **keywords) - new function with partial application
of the given arguments and keywords.
 
  Methods defined here:
__call__(...)
x.__call__(...) <==> x(...)
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__reduce__(...)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)

Data descriptors defined here:
__dict__
args
tuple of arguments to future partial calls
func
function object to use in future partial calls
keywords
dictionary of keyword arguments to future partial calls

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
cmp_to_key(mycmp)
Convert a cmp= function into a key= function
reduce(...)
reduce(function, sequence[, initial]) -> value
 
Apply a function of two arguments cumulatively to the items of a sequence,
from left to right, so as to reduce the sequence to a single value.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
of the sequence in the calculation, and serves as a default when the
sequence is empty.
total_ordering(cls)
Class decorator that fills in missing ordering methods
update_wrapper(wrapper, wrapped, assigned=('__module__', '__name__', '__doc__'), updated=('__dict__',))
Update a wrapper function to look like the wrapped function
 
wrapper is the function to be updated
wrapped is the original function
assigned is a tuple naming the attributes assigned directly
from the wrapped function to the wrapper function (defaults to
functools.WRAPPER_ASSIGNMENTS)
updated is a tuple naming the attributes of the wrapper that
are updated with the corresponding attribute from the wrapped
function (defaults to functools.WRAPPER_UPDATES)
wraps(wrapped, assigned=('__module__', '__name__', '__doc__'), updated=('__dict__',))
Decorator factory to apply update_wrapper() to a wrapper function
 
Returns a decorator that invokes update_wrapper() with the decorated
function as the wrapper argument and the arguments to wraps() as the
remaining arguments. Default arguments are as for update_wrapper().
This is a convenience function to simplify applying partial() to
update_wrapper().

 
Data
        WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__doc__')
WRAPPER_UPDATES = ('__dict__',)