MCPcopy Create free account
hub / github.com/pybind/pybind11 / has_fields

Method has_fields

include/pybind11/numpy.h:903–912  ·  view source on GitHub ↗

Returns true for structured data types.

Source from the content-addressed store, hash-verified

901
902 /// Returns true for structured data types.
903 bool has_fields() const {
904 if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
905 return detail::array_descriptor1_proxy(m_ptr)->names != nullptr;
906 }
907 const auto *proxy = detail::array_descriptor2_proxy(m_ptr);
908 if (proxy->type_num < 0 || proxy->type_num >= 2056) {
909 return false;
910 }
911 return proxy->names != nullptr;
912 }
913
914 /// Single-character code for dtype's kind.
915 /// For example, floating point types are 'f' and integral types are 'i'.

Callers 1

TEST_SUBMODULEFunction · 0.80

Calls 3

getFunction · 0.85
array_descriptor1_proxyFunction · 0.85
array_descriptor2_proxyFunction · 0.85

Tested by 1

TEST_SUBMODULEFunction · 0.64