We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a7cb00 commit 82455a4Copy full SHA for 82455a4
include/pybind11/numpy.h
@@ -647,8 +647,9 @@ class dtype : public object {
647
for (auto field : attr("fields").attr("items")()) {
648
auto spec = field.cast<tuple>();
649
auto name = spec[0].cast<pybind11::str>();
650
- auto format = spec[1].cast<tuple>()[0].cast<dtype>();
651
- auto offset = spec[1].cast<tuple>()[1].cast<pybind11::int_>();
+ auto spec_fo = spec[1].cast<tuple>();
+ auto format = spec_fo[0].cast<dtype>();
652
+ auto offset = spec_fo[1].cast<pybind11::int_>();
653
if ((len(name) == 0u) && format.kind() == 'V') {
654
continue;
655
}
0 commit comments