[Mlir-commits] [mlir] [MLIR][Python] Fix PDLResultList bindings (PR #161102)
Billy Zhu
llvmlistbot at llvm.org
Sun Sep 28 15:31:55 PDT 2025
https://github.com/zyx-billy created https://github.com/llvm/llvm-project/pull/161102
Adds argument names to the method stubs for PDLResultList.
>From 302b198fc73ca7b7ae684e113879639574536fad Mon Sep 17 00:00:00 2001
From: Billy Zhu <billyzhu at modular.com>
Date: Sun, 28 Sep 2025 15:23:28 -0700
Subject: [PATCH] add arg names
---
mlir/lib/Bindings/Python/Rewrite.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mlir/lib/Bindings/Python/Rewrite.cpp b/mlir/lib/Bindings/Python/Rewrite.cpp
index 20392b9002706..f18298ecaf415 100644
--- a/mlir/lib/Bindings/Python/Rewrite.cpp
+++ b/mlir/lib/Bindings/Python/Rewrite.cpp
@@ -155,7 +155,7 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
mlirPDLResultListPushBackValue(results, value);
},
// clang-format off
- nb::sig("def append(self, " MAKE_MLIR_PYTHON_QUALNAME("ir.Value") ")")
+ nb::sig("def append(self, value: " MAKE_MLIR_PYTHON_QUALNAME("ir.Value") ")")
// clang-format on
)
.def(
@@ -164,7 +164,7 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
mlirPDLResultListPushBackOperation(results, op);
},
// clang-format off
- nb::sig("def append(self, " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ")")
+ nb::sig("def append(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ")")
// clang-format on
)
.def(
@@ -173,7 +173,7 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
mlirPDLResultListPushBackType(results, type);
},
// clang-format off
- nb::sig("def append(self, " MAKE_MLIR_PYTHON_QUALNAME("ir.Type") ")")
+ nb::sig("def append(self, type: " MAKE_MLIR_PYTHON_QUALNAME("ir.Type") ")")
// clang-format on
)
.def(
@@ -182,7 +182,7 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
mlirPDLResultListPushBackAttribute(results, attr);
},
// clang-format off
- nb::sig("def append(self, " MAKE_MLIR_PYTHON_QUALNAME("ir.Attribute") ")")
+ nb::sig("def append(self, attr: " MAKE_MLIR_PYTHON_QUALNAME("ir.Attribute") ")")
// clang-format on
);
nb::class_<PyPDLPatternModule>(m, "PDLModule")
More information about the Mlir-commits
mailing list