Skip to content

Commit b59299d

Browse files
author
Bertrand MICHEL
committed
[dtype] change type() name method to char_() to be compliant with Python numpy interface
1 parent df1be99 commit b59299d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/pybind11/numpy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class dtype : public object {
513513
}
514514

515515
/// Single-character for dtype's type (ex: float is 'f' and double 'd')
516-
char type() const {
516+
char char_() const {
517517
return detail::array_descriptor_proxy(m_ptr)->type;
518518
}
519519

tests/test_numpy_dtypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ py::list test_dtype_type() {
278278
py::dtype("float64"), // double
279279
py::dtype("float128") // long double
280280
}) {
281-
list.append(dt.type());
281+
list.append(dt.char_());
282282
}
283283
return list;
284284
}

0 commit comments

Comments
 (0)