[Mlir-commits] [mlir] [mlir][python] meta region_op (PR #75673)

Stella Laurenzo llvmlistbot at llvm.org
Tue Dec 19 18:10:19 PST 2023


================
@@ -211,3 +211,7 @@ def __init__(
         if operands is None:
             operands = []
         super().__init__(_get_op_results_or_values(operands), loc=loc, ip=ip)
+
+
+def any_op_t():
----------------
stellaraccident wrote:

Not familiar with this code and what AnyOpType is, but is that actually a descendent of a Python `type`? If not, it's going to make the various tools unhappy to use it in signatures. (answering my own question: appears not)

I think you need to do an additional indirection here to make things happy. Easiest thing is to use something like `typine.newtype`. iirc, there is also another way to create an annotated type that the type checkers will look through. You can also, of course go full on dependent typing with metaclasses...

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


More information about the Mlir-commits mailing list