filter functools.partial sum on one line