[Mlir-commits] [mlir] [MLIR][Python] add/fix docstrings in IRCore (PR #167063)

Jacques Pienaar llvmlistbot at llvm.org
Fri Nov 7 22:34:06 PST 2025


================
@@ -3692,7 +3869,22 @@ void mlir::python::populateIRCore(nb::module_ &m) {
           nb::arg("operands") = nb::none(), nb::arg("attributes") = nb::none(),
           nb::arg("successors") = nb::none(), nb::arg("regions") = 0,
           nb::arg("loc") = nb::none(), nb::arg("ip") = nb::none(),
-          nb::arg("infer_type") = false, kOperationCreateDocstring)
+          nb::arg("infer_type") = false,
+          R"(
+            Creates a new operation.
+
+            Args:
+              name: Operation name (e.g. "dialect.operation").
+              results: Optional sequence of Type representing op result types.
+              operands: Optional operands of the operation.
+              attributes: Optional Dict of {str: Attribute}.
+              successors: Optional List of Block for the operation's successors.
+              regions: Number of regions to create (default = 0).
+              location: Optional Location object (defaults to resolve from context manager).
+              ip: Optional InsertionPoint (defaults to resolve from context manager or set to False to disable insertion, even with an insertion point set in the context manager).
+              infer_type: Whether to infer result types (default = False).
+            Returns:
+              A new "detached" Operation object. Detached operations can be added to blocks, which causes them to become "attached.")")
----------------
jpienaar wrote:

Apparently position of period here depends on US vs UK style followed. So commenting to remind myself but good.

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


More information about the Mlir-commits mailing list