@@ -167,7 +167,7 @@ struct nb_buffer_info {
167167};
168168
169169class  nb_buffer  : public  nb ::object {
170-   NB_OBJECT_DEFAULT (nb_buffer, object, " buffer "  , PyObject_CheckBuffer);
170+   NB_OBJECT_DEFAULT (nb_buffer, object, " Buffer "  , PyObject_CheckBuffer);
171171
172172  nb_buffer_info request () const  {
173173    int  flags = PyBUF_STRIDES | PyBUF_FORMAT;
@@ -252,9 +252,12 @@ class PyAffineMapAttribute : public PyConcreteAttribute<PyAffineMapAttribute> {
252252          return  PyAffineMapAttribute (affineMap.getContext (), attr);
253253        },
254254        nb::arg (" affine_map"  ), " Gets an attribute wrapping an AffineMap."  );
255-     c.def_prop_ro (" value"  , mlirAffineMapAttrGetValue,
256-                   nb::sig (" def value(self) -> AffineMap"  ),
257-                   " Returns the value of the AffineMap attribute"  );
255+     c.def_prop_ro (
256+         " value"  , mlirAffineMapAttrGetValue,
257+         //  clang-format off
258+                   nb::sig (" def value(self) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.AffineMap"  )),
259+         //  clang-format on
260+         " Returns the value of the AffineMap attribute"  );
258261  }
259262};
260263
@@ -492,7 +495,9 @@ class PyArrayAttribute : public PyConcreteAttribute<PyArrayAttribute> {
492495      nb::class_<PyArrayAttributeIterator>(m, " ArrayAttributeIterator"  )
493496          .def (" __iter__"  , &PyArrayAttributeIterator::dunderIter)
494497          .def (" __next__"  , &PyArrayAttributeIterator::dunderNext,
495-                nb::sig (" def __next__(self) -> Attribute"  ));
498+                //  clang-format off
499+                nb::sig (" def __next__(self) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Attribute"  )));
500+       //  clang-format on
496501    }
497502
498503  private: 
@@ -526,7 +531,9 @@ class PyArrayAttribute : public PyConcreteAttribute<PyArrayAttribute> {
526531             throw  nb::index_error (" ArrayAttribute index out of range"  );
527532           return  arr.getItem (i);
528533         },
529-          nb::sig (" def __getitem__(self, arg: int, /) -> Attribute"  ))
534+          //  clang-format off
535+          nb::sig (" def __getitem__(self, arg: int, /) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Attribute"  )))
536+         //  clang-format on
530537        .def (" __len__"  ,
531538             [](const  PyArrayAttribute &arr) {
532539               return  mlirArrayAttrGetNumElements (arr);
@@ -620,7 +627,9 @@ class PyIntegerAttribute : public PyConcreteAttribute<PyIntegerAttribute> {
620627        [](nb::object & /* class*/  ) -> MlirTypeID {
621628          return  mlirIntegerAttrGetTypeID ();
622629        },
623-         nb::sig (" def static_typeid(/) -> TypeID"  ));
630+         //  clang-format off
631+         nb::sig (" def static_typeid(/) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.TypeID"  )));
632+     //  clang-format on
624633  }
625634
626635private: 
@@ -679,16 +688,18 @@ class PySymbolRefAttribute : public PyConcreteAttribute<PySymbolRefAttribute> {
679688  }
680689
681690  static  void  bindDerived (ClassTy &c) {
682-     c.def_static (
683-         " get"  ,
684-         [](const  std::vector<std::string> &symbols,
685-            DefaultingPyMlirContext context) {
686-           return  PySymbolRefAttribute::fromList (symbols, context.resolve ());
687-         },
688-         nb::arg (" symbols"  ), nb::arg (" context"  ) = nb::none (),
689-         nb::sig (" def get(symbols: Sequence[str], context: mlir.ir.Context | " 
690-                 " None = None) -> Attribute"  ),
691-         " Gets a uniqued SymbolRef attribute from a list of symbol names"  );
691+     c
692+         .def_static (
693+             " get"  ,
694+             [](const  std::vector<std::string> &symbols,
695+                DefaultingPyMlirContext context) {
696+               return  PySymbolRefAttribute::fromList (symbols, context.resolve ());
697+             },
698+             nb::arg (" symbols"  ), nb::arg (" context"  ) = nb::none (),
699+             //  clang-format off
700+         nb::sig (" def get(symbols: Sequence[str], context: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Context"  ) "  | None = None) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Attribute"  )),
701+             //  clang-format on
702+             " Gets a uniqued SymbolRef attribute from a list of symbol names"  );
692703    c.def_prop_ro (
693704        " value"  ,
694705        [](PySymbolRefAttribute &self) {
@@ -754,7 +765,11 @@ class PyOpaqueAttribute : public PyConcreteAttribute<PyOpaqueAttribute> {
754765          return  PyOpaqueAttribute (context->getRef (), attr);
755766        },
756767        nb::arg (" dialect_namespace"  ), nb::arg (" buffer"  ), nb::arg (" type"  ),
757-         nb::arg (" context"  ) = nb::none (), " Gets an Opaque attribute."  );
768+         nb::arg (" context"  ) = nb::none (),
769+         //  clang-format off
770+         nb::sig (" def get(dialect_namespace: str, buffer: typing_extensions.Buffer, type: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Type"  ) " , context: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Context"  ) "  | None = None) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.OpaqueAttr"  )),
771+         //  clang-format on
772+         " Gets an Opaque attribute."  );
758773    c.def_prop_ro (
759774        " dialect_namespace"  ,
760775        [](PyOpaqueAttribute &self) {
@@ -1040,6 +1055,9 @@ class PyDenseElementsAttribute
10401055                    nb::arg (" array"  ), nb::arg (" signless"  ) = true ,
10411056                    nb::arg (" type"  ) = nb::none (), nb::arg (" shape"  ) = nb::none (),
10421057                    nb::arg (" context"  ) = nb::none (),
1058+                     //  clang-format off
1059+                     nb::sig (" def get(array: typing_extensions.Buffer, signless: bool = True, type: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Type"  ) "  | None = None, shape: Sequence[int] | None = None, context: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Context"  ) "  | None = None) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.DenseElementsAttr"  )),
1060+                     //  clang-format on
10431061                    kDenseElementsAttrGetDocstring )
10441062        .def_static (" get"  , PyDenseElementsAttribute::getFromList,
10451063                    nb::arg (" attrs"  ), nb::arg (" type"  ) = nb::none (),
@@ -1060,7 +1078,9 @@ class PyDenseElementsAttribute
10601078                    " get_splat_value called on a non-splat attribute"  );
10611079              return  mlirDenseElementsAttrGetSplatValue (self);
10621080            },
1063-             nb::sig (" def get_splat_value(self) -> Attribute"  ));
1081+             //  clang-format off
1082+             nb::sig (" def get_splat_value(self) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Attribute"  )));
1083+     //  clang-format on
10641084  }
10651085
10661086  static  PyType_Slot slots[];
@@ -1520,6 +1540,9 @@ class PyDenseResourceElementsAttribute
15201540                 nb::arg (" array"  ), nb::arg (" name"  ), nb::arg (" type"  ),
15211541                 nb::arg (" alignment"  ) = nb::none (),
15221542                 nb::arg (" is_mutable"  ) = false , nb::arg (" context"  ) = nb::none (),
1543+                  //  clang-format off
1544+                  nb::sig (" def get_from_buffer(array: typing_extensions.Buffer, name: str, type: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Type"  ) " , alignment: int | None = None, is_mutable: bool = False, context: "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Context"  ) "  | None = None) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.DenseResourceElementsAttr"  )),
1545+                  //  clang-format on
15231546                 kDenseResourceElementsAttrGetFromBufferDocstring );
15241547  }
15251548};
@@ -1571,7 +1594,9 @@ class PyDictAttribute : public PyConcreteAttribute<PyDictAttribute> {
15711594            throw  nb::key_error (" attempt to access a non-existent attribute"  );
15721595          return  attr;
15731596        },
1574-         nb::sig (" def __getitem__(self, arg: str, /) -> Attribute"  ));
1597+         //  clang-format off
1598+         nb::sig (" def __getitem__(self, arg: str, /) -> "   MAKE_MLIR_PYTHON_QUALNAME (" ir.Attribute"  )));
1599+     //  clang-format on
15751600    c.def (" __getitem__"  , [](PyDictAttribute &self, intptr_t  index) {
15761601      if  (index < 0  || index >= self.dunderLen ()) {
15771602        throw  nb::index_error (" attempt to access out of bounds attribute"  );
@@ -1640,7 +1665,7 @@ class PyTypeAttribute : public PyConcreteAttribute<PyTypeAttribute> {
16401665    c.def_prop_ro (
16411666        " value"  ,
16421667        [](PyTypeAttribute &self) { return  mlirTypeAttrGetValue (self.get ()); },
1643-         nb::sig (" def value(self) -> Type"  ));
1668+         nb::sig (" def value(self) -> "   MAKE_MLIR_PYTHON_QUALNAME ( " ir. Type" ) ));
16441669  }
16451670};
16461671
@@ -1777,6 +1802,7 @@ nb::object symbolRefOrFlatSymbolRefAttributeCaster(PyAttribute &pyAttribute) {
17771802} //  namespace
17781803
17791804void  mlir::python::populateIRAttributes (nb::module_ &m) {
1805+ 
17801806  PyAffineMapAttribute::bind (m);
17811807  PyDenseBoolArrayAttribute::bind (m);
17821808  PyDenseBoolArrayAttribute::PyDenseArrayIterator::bind (m);
0 commit comments