[Mlir-commits] [mlir] [MLIR][Python] Fix overly specific type annotation on PyValue.owner (PR #178003)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jan 26 09:54:48 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Rolf Morel (rolfmorel)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) mlir/lib/Bindings/Python/IRCore.cpp (+1-1) 


``````````diff
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index eb00363a54034..bea2ed4d3229f 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -4537,7 +4537,7 @@ void populateIRCore(nb::module_ &m) {
           kDumpDocstring)
       .def_prop_ro(
           "owner",
-          [](PyValue &self) -> nb::typed<nb::object, PyOpView> {
+          [](PyValue &self) -> nb::typed<nb::object, std::variant<PyOpView, PyBlock>> {
             MlirValue v = self.get();
             if (mlirValueIsAOpResult(v)) {
               assert(mlirOperationEqual(self.getParentOperation()->get(),

``````````

</details>


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


More information about the Mlir-commits mailing list