I want to call a python iterable from c++. Can I do this? while (true) { T n = extract<T> (o.attr ("next")()); tmp.push_back (n); } How do I (can I?) catch the StopIteration exception?