[Mlir-commits] [mlir] [MLIR][Python] Add more field specifiers to Python-defined operations (PR #188064)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Mar 28 01:49:35 PDT 2026


================
@@ -108,25 +111,70 @@ def _lower(self, type_) -> ir.Value:
 
 @dataclass
 class FieldSpecifier:
+    type_: Any = None
     infer_type: bool = False
     default_is_none: bool = False
+    default_factory: Optional[Callable[[], Any]] = None
+    kw_only: bool = False
 
-    def __post_init__(self):
-        if self.infer_type and self.default_is_none:
-            raise ValueError(
-                "a field cannot be marked with both infer_type and default_is_none"
-            )
-
-    def kw_only(self) -> bool:
-        return self.default_is_none or self.infer_type
+    def param_kind(self):
----------------
PragmaTwice wrote:

Done.

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


More information about the Mlir-commits mailing list