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

Rolf Morel llvmlistbot at llvm.org
Mon Jan 26 09:54:14 PST 2026


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

None

>From df56e495b8c6e2f8fff11745e53d351e1cfa9257 Mon Sep 17 00:00:00 2001
From: Rolf Morel <rolf.morel at intel.com>
Date: Mon, 26 Jan 2026 17:52:55 +0000
Subject: [PATCH] [MLIR][Python] Fix overly specific type annotation on
 PyValue.owner

---
 mlir/lib/Bindings/Python/IRCore.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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(),



More information about the Mlir-commits mailing list