10000 Unwrap back_reference in get_pytype() · boostorg/python@0102b31 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0102b31

Browse files
jvansantenstefanseefeld
authored andcommitted
Unwrap back_reference in get_pytype()
This prevents back_reference parameters from decaying to "object" in py signatures
1 parent 4c6f40f commit 0102b31

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

include/boost/python/converter/pytype_function.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# include <boost/python/converter/registered.hpp>
1010
# include <boost/python/detail/unwind_type.hpp>
1111
# include <boost/python/detail/type_traits.hpp>
12-
12+
# include <boost/python/back_reference.hpp>
1313

1414
namespace boost { namespace python {
1515

@@ -46,6 +46,12 @@ inline python::type_info unwind_type_id_(boost::type<T>* = 0, mpl::false_ * =0)
4646
return boost::python::detail::unwind_type<unwind_type_id_helper, T> ();
4747
}
4848

49+
template <class T>
50+
inline python::type_info unwind_type_id_(boost::type<back_reference<T> >* = 0, mpl::false_ * =0)
51+
{
52+
return boost::python::detail::unwind_type<unwind_type_id_helper, T> ();
53+
}
54+
4955
inline python::type_info unwind_type_id_(boost::type<void>* = 0, mpl::true_* =0)
5056
{
5157
return type_id<void>();

test/map_indexing_suite.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@
214214
... i.data()
215215
4
216216
217+
#####################################################################
218+
# Test signature...
219+
#####################################################################
220+
221+
>>> AMap.__iter__.__doc__.strip().split("\\n")[0]
222+
'__iter__( (AMap)arg1) -> __main__.iterator :'
223+
217224
#####################################################################
218225
# END....
219226
#####################################################################

0 commit comments

Comments
 (0)
0