Skip to content

Commit

Permalink
Small fixups (shouldn't matter)?
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Mar 11, 2024
1 parent 0d585db commit 5c09fcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ struct PyArrayDescr2_Proxy {
PyObject *metadata;
Py_hash_t hash;
void *reserved_null[2];
/* The following fields only exist if 0 < type_num < 2000 */
struct _arr_descr *subarray;
/* The following fields only exist if 0 < type_num < 2056 */
char *subarray;
PyObject *fields;
PyObject *names;
};
Expand Down Expand Up @@ -691,7 +691,7 @@ class dtype : public object {
if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
return detail::array_descriptor1_proxy(m_ptr)->names != nullptr;
}
if (num() < 0 || num() > 2000) {
if (num() < 0 || num() > 2056) {
return false;
}
return detail::array_descriptor2_proxy(m_ptr)->names != nullptr;
Expand Down

0 comments on commit 5c09fcf

Please sign in to comment.