[Mlir-commits] [mlir] [mlir][py] Mark all type caster `from_{cpp, python}` methods as noexcept (PR #143866)
Nicholas Junge
llvmlistbot at llvm.org
Sat Jul 5 02:40:06 PDT 2025
nicholasjng wrote:
Fair. I thought since he authored that code, I might get some insights about what I have to watch out for.
I propose to make `mlirApiObjectToCapsule` return `nullptr` on failure instead of throwing a TypeError, and then returning `false` in the type casters if the obtained capsule is null.
The error handling on the Python side should stay about the same, since nanobind itself will throw a type error after it exhaused all type caster overloads for a given type. But I should implement it first before making assumptions.
I'll ping you when I'm ready with the refactoring. Thanks for coming back to this!
https://github.com/llvm/llvm-project/pull/143866
More information about the Mlir-commits
mailing list