From 0102b319454feffaaad205c7eb028cc6da8210bf Mon Sep 17 00:00:00 2001 From: Jakob van Santen Date: Tue, 9 May 2023 11:37:27 +0200 Subject: [PATCH] Unwrap back_reference in get_pytype() This prevents back_reference parameters from decaying to "object" in py signatures --- include/boost/python/converter/pytype_function.hpp | 8 +++++++- test/map_indexing_suite.py | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/python/converter/pytype_function.hpp b/include/boost/python/converter/pytype_function.hpp index 8e0a4e79..d072b55f 100644 --- a/include/boost/python/converter/pytype_function.hpp +++ b/include/boost/python/converter/pytype_function.hpp @@ -9,7 +9,7 @@ # include # include # include - +# include namespace boost { namespace python { @@ -46,6 +46,12 @@ inline python::type_info unwind_type_id_(boost::type* = 0, mpl::false_ * =0) return boost::python::detail::unwind_type (); } +template +inline python::type_info unwind_type_id_(boost::type >* = 0, mpl::false_ * =0) +{ + return boost::python::detail::unwind_type (); +} + inline python::type_info unwind_type_id_(boost::type* = 0, mpl::true_* =0) { return type_id(); diff --git a/test/map_indexing_suite.py b/test/map_indexing_suite.py index e772bb53..6d3e57a1 100644 --- a/test/map_indexing_suite.py +++ b/test/map_indexing_suite.py @@ -214,6 +214,13 @@ joel kimpo ... i.data() 4 +##################################################################### +# Test signature... +##################################################################### + +>>> AMap.__iter__.__doc__.strip().split("\\n")[0] +'__iter__( (AMap)arg1) -> __main__.iterator :' + ##################################################################### # END.... #####################################################################