Rework implementation of reductions for Python objects