[Mlir-commits] [mlir] [MLIR][Python][Docs] Fix example of Python-defined dialects (PR #188174)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Mar 23 22:04:08 PDT 2026


https://github.com/PragmaTwice created https://github.com/llvm/llvm-project/pull/188174

Some breaking changes are introduced in #186574 for Python-defined dialects. So we need to fix the example in the docs.

>From 11176f175086cdbfba6c26d068f31bf91f28d8b9 Mon Sep 17 00:00:00 2001
From: Twice <twice at apache.org>
Date: Tue, 24 Mar 2026 13:03:42 +0800
Subject: [PATCH] [MLIR][Python][Docs] Fix example of Python-defined dialects

Some breaking changes are introduced in #186574 for Python-defined dialects. So we need to fix the example in the docs.
---
 mlir/docs/Bindings/Python.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/docs/Bindings/Python.md b/mlir/docs/Bindings/Python.md
index f13dcdb99d63f..df186e43219c2 100644
--- a/mlir/docs/Bindings/Python.md
+++ b/mlir/docs/Bindings/Python.md
@@ -1307,12 +1307,12 @@ class MyInt(Dialect, name="myint"):
 
 class ConstantOp(MyInt.Operation, name="constant"):
     value: IntegerAttr
-    cst: Result[IntegerType[32]]
+    cst: Result[IntegerType[32]] = result(infer_type=True)
 
 class AddOp(MyInt.Operation, name="add"):
     lhs: Operand[IntegerType[32]]
     rhs: Operand[IntegerType[32]]
-    res: Result[IntegerType[32]]
+    res: Result[IntegerType[32]] = result(infer_type=True)
 
 # The code below requires an available MLIR context and location.
 



More information about the Mlir-commits mailing list