I'd use Py_ssize_t here for n as well...