maxiter = inf if maxiter is None else maxiter