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 0a87436
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct PyArrayDescr_Proxy {
};
#else
/* NumPy 1.x only, we can expose all fields */
typedef PyArrayDescr1_Proxy PyArrayDescr_Proxy;
using PyArrayDescr_Proxy = PyArrayDescr1_Proxy;
#endif

/* NumPy 2 proxy, including legacy fields */
Expand All @@ -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 0a87436

Please sign in to comment.