mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-02 04:53:26 +08:00
Fix a comment and wrong indentation
This commit is contained in:
parent
b51fa02cc3
commit
b37985ee0c
@ -134,8 +134,7 @@ public:
|
|||||||
array(const buffer_info &info) {
|
array(const buffer_info &info) {
|
||||||
auto& api = lookup_api();
|
auto& api = lookup_api();
|
||||||
|
|
||||||
// _dtype_from_pep3118 returns dtypes with padding fields in, however the array
|
// _dtype_from_pep3118 returns dtypes with padding fields in, so we need to strip them
|
||||||
// constructor seems to then consume them, so we don't need to strip them ourselves
|
|
||||||
auto numpy_internal = module::import("numpy.core._internal");
|
auto numpy_internal = module::import("numpy.core._internal");
|
||||||
auto dtype_from_fmt = (object) numpy_internal.attr("_dtype_from_pep3118");
|
auto dtype_from_fmt = (object) numpy_internal.attr("_dtype_from_pep3118");
|
||||||
auto dtype = strip_padding_fields(dtype_from_fmt(pybind11::str(info.format)));
|
auto dtype = strip_padding_fields(dtype_from_fmt(pybind11::str(info.format)));
|
||||||
@ -175,7 +174,7 @@ protected:
|
|||||||
auto format = spec[1].cast<tuple>()[0].cast<object>();
|
auto format = spec[1].cast<tuple>()[0].cast<object>();
|
||||||
auto offset = spec[1].cast<tuple>()[1].cast<int_>();
|
auto offset = spec[1].cast<tuple>()[1].cast<int_>();
|
||||||
if (!len(name) && (std::string) dtype.attr("kind").cast<pybind11::str>() == "V")
|
if (!len(name) && (std::string) dtype.attr("kind").cast<pybind11::str>() == "V")
|
||||||
continue;
|
continue;
|
||||||
field_descriptors.push_back({name, strip_padding_fields(format), offset});
|
field_descriptors.push_back({name, strip_padding_fields(format), offset});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user