[Mlir-commits] [mlir] [mlir][py] Mark all type caster `from_{cpp, python}` methods as noexcept (PR #143866)

Nicholas Junge llvmlistbot at llvm.org
Fri Jul 11 03:38:59 PDT 2025


nicholasjng wrote:

Thanks! I started checking the casts, and found two more `nanobind::cast<MlirTypeID>` in `Bindings/Python/IRModule.h`.

However, they are casting from an `nb::object` coming out of a `nanobind::cast(v)`, where `v` is the class instance, which is always a `PyType/PyAttribute`, so I think those can never fail.

It might also be necessary to check some of the other `nanobind::cast(v)` calls, where `v` is some C++ type convertible to a `MlirSOMETHING`.

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


More information about the Mlir-commits mailing list