[Mlir-commits] [mlir] [mlir][Python] use canonical Python `isinstance` instead of `Type.isinstance` (PR #172892)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Dec 18 11:28:21 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r origin/main...HEAD mlir/python/mlir/dialects/arith.py mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py mlir/python/mlir/dialects/memref.py mlir/test/python/dialects/arith_dialect.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- python/mlir/dialects/arith.py 2025-12-18 19:22:57.000000 +0000
+++ python/mlir/dialects/arith.py 2025-12-18 19:27:53.115571 +0000
@@ -24,16 +24,18 @@
@_ods_cext.register_operation(_Dialect, replace=True)
class ConstantOp(ConstantOp):
"""Specialization for the constant op class."""
@overload
- def __init__(self, value: Attribute, *, loc=None, ip=None): ...
+ def __init__(self, value: Attribute, *, loc=None, ip=None):
+ ...
@overload
def __init__(
self, result: Type, value: Union[int, float, _array], *, loc=None, ip=None
- ): ...
+ ):
+ ...
def __init__(self, result, value, *, loc=None, ip=None):
if value is None:
assert isinstance(result, Attribute)
super().__init__(result, loc=loc, ip=ip)
``````````
</details>
https://github.com/llvm/llvm-project/pull/172892
More information about the Mlir-commits
mailing list