[Mlir-commits] [mlir] [mlir][python] remove mixins (PR #68853)

Maksim Levental llvmlistbot at llvm.org
Thu Oct 12 20:45:30 PDT 2023


================
@@ -1,5 +1,50 @@
-#  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.                                        
-#  See https://llvm.org/LICENSE.txt for license information.                                                            
-#  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception    
+#  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+#  See https://llvm.org/LICENSE.txt for license information.
+#  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 from ._affine_ops_gen import *
+from ._affine_ops_gen import _Dialect
+
+try:
+    from ..ir import *
+    from ._ods_common import (
+        get_op_result_or_value as _get_op_result_or_value,
+        get_op_results_or_values as _get_op_results_or_values,
+        _cext as _ods_cext,
+    )
+except ImportError as e:
+    raise RuntimeError("Error loading imports from extension module") from e
+
+from typing import Optional, Sequence, Union
+
+
+ at _ods_cext.register_operation(_Dialect, replace=True)
----------------
makslevental wrote:

You wouldn't be able to construct with your chosen set of args though (assuming your extension munges args differently of course). Anyway I think it's a reasonable cost to pay in exchange for not having the  current, non-obvious, mechanism that magically finds the corresponding extension class :)

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


More information about the Mlir-commits mailing list