should ndim just be a Py_ssize_t?