[Mlir-commits] [mlir] [MLIR][Python] add type hints for accessors (PR #158455)

Maksim Levental llvmlistbot at llvm.org
Tue Sep 16 09:28:33 PDT 2025


================
@@ -449,6 +486,72 @@ static void emitResultAccessors(const Operator &op, raw_ostream &os) {
                        getNumResults(op), getResult);
 }
 
+static std::string getPythonAttrName(mlir::tblgen::Attribute attr) {
+  auto storageTypeStr = attr.getStorageType();
----------------
makslevental wrote:

Yea I think that's a good idea - specifically an optional field on TD types that's something like `python_type_annotation`. Of course as with all things "core", I wonder if there will be complaints 🤷.

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


More information about the Mlir-commits mailing list