Skip to content

Commit 400ffea

Browse files
committed
Clarify documentation and move note about dtype.char vs PyArray_Descr::type to a plain, non-doxygen comment
1 parent f455222 commit 400ffea

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

include/pybind11/numpy.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,18 @@ class dtype : public object {
507507
return detail::array_descriptor_proxy(m_ptr)->names != nullptr;
508508
}
509509

510-
/**
511-
* Single-character for dtype's kind
512-
* ex: float and double are 'f' or int and long int are 'i',
513-
* i.e. "float and double" could be "floating point types",
514-
* and "int and long" could be "integral types")
515-
*/
510+
/// Single-character code for dtype's kind.
511+
/// For example, floating point types are 'f' and integral types are 'i'.
516512
char kind() const {
517513
return detail::array_descriptor_proxy(m_ptr)->kind;
518514
}
519515

520-
/** Single-character for dtype's type (ex: float is 'f' and double 'd').
521-
* NB: Following the Python API (i.e., dtype.char) is preferred here
522-
* rather than NumPy's internal C API (PyArray_Descr::type)
523-
*/
516+
/// Single-character for dtype's type.
517+
/// For example, ``float`` is 'f', ``double`` 'd', ``int`` 'i', and ``long`` 'd'.
524518
char char_() const {
519+
// Note: The signature, `dtype::char_` follows the naming of NumPy's
520+
// public Python API (i.e., ``dtype.char``), rather than its internal
521+
// C API (``PyArray_Descr::type``).
525522
return detail::array_descriptor_proxy(m_ptr)->type;
526523
}
527524

0 commit comments

Comments
 (0)