Issue |
127518
|
Summary |
[mlir][python] Types created by `mlir_type_subclass` are ignored by `nanobind`'s `stubgen`
|
Labels |
mlir
|
Assignees |
jpienaar
|
Reporter |
ingomueller-net
|
If we expose an `mlir::Type` to Python using `mlir_type_subclass` (like [here](https://github.com/llvm/llvm-project/blob/6a30076/mlir/lib/Bindings/Python/DialectGPU.cpp#L33)), `nanobind`'s [`stubgen`](https://nanobind.readthedocs.io/en/latest/typing.html#stub-generation) does not create any output for that class. This is unlike functions using `nb::class_` (like [this example](https://nanobind.readthedocs.io/en/latest/api_core.html#_CPPv4I0DpEN8nanobind6class_3defER6class_PKcRR4FuncDpRK5Extra).
I believe that `stubgen` only creates typing information for a class if the `type(.)` of the class object is a subclass of `type` (according to [this](https://github.com/wjakob/nanobind/blob/ab05b016/src/stubgen.py#L845) test), which isn't the case for how `mlir_type_subclass` currently works.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs