[Mlir-commits] [mlir] [MLIR][Python] Register Containers as Sequences for `match` compatibility (PR #174091)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jan 1 02:05:41 PST 2026


================
@@ -4951,6 +4951,22 @@ void mlir::python::populateIRCore(nb::module_ &m) {
   PyRegionIterator::bind(m);
   PyRegionList::bind(m);
 
+  // Register containers as Sequences, so they can be used with `match`.
----------------
MaPePeR wrote:

Moved the registration to that file and into the `_site_initialize` function, because there `ir` is imported.

Though I found it quite fitting on the cpp side, because it alleviated my concerns, that the code wouldn't run when the classes were imported in the wrong way and, at least to me, the `_mlir_libs`, structure is quite opaque and confusing.

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


More information about the Mlir-commits mailing list