[Mlir-commits] [llvm] [mlir] [mlir python] Port Python core code to nanobind. (PR #118583)

Maksim Levental llvmlistbot at llvm.org
Wed Dec 11 22:15:25 PST 2024


================
@@ -205,14 +316,13 @@ class PyDenseArrayAttribute : public PyConcreteAttribute<DerivedT> {
     EltTy dunderNext() {
       // Throw if the index has reached the end.
       if (nextIndex >= mlirDenseArrayGetNumElements(attr.get()))
-        throw py::stop_iteration();
+        throw nb::stop_iteration();
----------------
makslevental wrote:

What's the lower level alternative? AFAIK throwing `StopIteration` is only way to exit a generator?

https://github.com/llvm/llvm-project/pull/118583


More information about the Mlir-commits mailing list