import reduce only in python3