[all-commits] [llvm/llvm-project] 2a448d: [mlir][python] Make types in register_(dialect|ope...
Ingo Müller via All-commits
all-commits at lists.llvm.org
Mon Nov 11 00:26:36 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2a448da6e63e2cd3dac63d5398bf121e994d7fc2
https://github.com/llvm/llvm-project/commit/2a448da6e63e2cd3dac63d5398bf121e994d7fc2
Author: Ingo Müller <ingomueller at google.com>
Date: 2024-11-11 (Mon, 11 Nov 2024)
Changed paths:
M mlir/lib/Bindings/Python/MainModule.cpp
M mlir/python/mlir/_mlir_libs/_mlir/__init__.pyi
Log Message:
-----------
[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 at google.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list