functools.partial is 2.5+