From d3f74eb0567b557f261018131a04ab5eed3ddb7e Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 1 Jun 2018 15:53:46 +0200 Subject: Simple Python test working Signed-off-by: David Shah --- common/pybindings.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/pybindings.cc b/common/pybindings.cc index 22c06c2e..839ba7df 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -37,6 +37,7 @@ using namespace boost::python; A wrapper for a Pythonised nextpnr Iterator. The actual class wrapped is a pair containing (current, end) */ + template struct iterator_wrapper { typedef decltype(*(std::declval())) value_t; @@ -56,7 +57,7 @@ struct iterator_wrapper { static void wrap(const char *python_name) { class_>(python_name, no_init) - .def("next", next); + .def("__next__", next); } }; @@ -65,7 +66,6 @@ A wrapper for a nextpnr Range. Ranges should have two functions, begin() and end() which return iterator-like objects supporting ++, * and != Full STL iterator semantics are not required, unlike the standard Boost wrappers */ -inline object pass_through(object const &o) { return o; } template struct range_wrapper { -- cgit v1.2.3