From 41c339902123b96ce3bf23f2522758f5d4954be8 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 18 Jul 2016 19:58:20 +0100 Subject: [PATCH] Update npy_format_descriptor::name() --- example/example20.py | 2 ++ include/pybind11/numpy.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/example/example20.py b/example/example20.py index 85ea9ae5f..bb57590c3 100644 --- a/example/example20.py +++ b/example/example20.py @@ -70,3 +70,5 @@ check_eq(arr, [((False, 0, 0.0), (True, 1, 1.5)), ((True, 1, 1.5), (False, 2, 3.0)), ((False, 2, 3.0), (True, 3, 4.5))], nested_dtype) print_rec_nested(arr) + +assert create_rec_nested.__doc__.strip().endswith('numpy.ndarray[dtype=NestedStruct]') diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 58d9695fe..030787b7d 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -281,7 +281,7 @@ struct field_descriptor { template struct npy_format_descriptor::value>::type> { - static PYBIND11_DESCR name() { return _("user-defined"); } + static PYBIND11_DESCR name() { return _("struct"); } static object dtype() { if (!dtype_())