functools is a module for the Python language which provides support for working with higher-order functions: functions that act on or return other functions