acc will never be None, right, because you set it to zeroValue? You can probably just `yield acc`.