Python 3 compatibility. Import functools.reduce.