py3 reduce fix