[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:40 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Twice (PragmaTwice)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/188174.diff


1 Files Affected:

- (modified) mlir/docs/Bindings/Python.md (+2-2) 


``````````diff
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.
 

``````````

</details>


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


More information about the Mlir-commits mailing list