20 template <
typename TmplExtractType>
22 boost::python::object &iteratable
26 m_iter(iteratable.attr(
"__iter__")())
31 template <
typename TmplExtractType>
37 template <
typename TmplExtractType>
40 boost::python::object next = m_next;
42 return boost::python::extract<TmplExtractType>(next);
45 template <
typename TmplExtractType>
50 #if PY_VERSION_HEX >= 0x03000000
51 m_next = m_iter.attr(
"__next__")();
53 m_next = m_iter.attr(
"next")();
56 catch (boost::python::error_already_set &e)
58 if (!PyErr_ExceptionMatches(PyExc_StopIteration))