llvm-project
2a448da6 - [mlir][python] Make types in register_(dialect|operation) more narrow. (#115307)

Commit
1 year ago
[mlir][python] Make types in register_(dialect|operation) more narrow. (#115307) This PR makes the `pyClass`/`dialectClass` arguments of the pybind11 functions `register_dialect` and `register_operation` as well as their return types more narrow, concretely, a `py::type` instead of a `py::object`. As the name of the arguments indicate, they have to be called with a type instance (a "class"). The PR also updates the typing stubs of these functions (in the corresponding `.pyi` file), such that static type checkers are aware of the changed type. With the previous typing information, `pyright` raised errors on code generated by tablegen. Signed-off-by: Ingo Müller <ingomueller@google.com>
Parents
Loading