Skip to content

Commit 1072611

Browse files
superbobrySterling-Augustine
authored andcommitted
A few tweaks to the MLIR .pyi files (llvm#110488)
1 parent b75e26b commit 1072611

File tree

7 files changed

+197
-211
lines changed

7 files changed

+197
-211
lines changed

mlir/python/mlir/_mlir_libs/_mlir/__init__.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from typing import List
21

32
globals: "_Globals"
43

54
class _Globals:
6-
dialect_search_modules: List[str]
5+
dialect_search_modules: list[str]
76
def _register_dialect_impl(self, dialect_namespace: str, dialect_class: type) -> None: ...
87
def _register_operation_impl(self, operation_name: str, operation_class: type) -> None: ...
98
def append_dialect_search_prefix(self, module_name: str) -> None: ...

mlir/python/mlir/_mlir_libs/_mlir/dialects/pdl.pyi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
from typing import Optional
65

76
from mlir.ir import Type, Context
87

@@ -26,15 +25,15 @@ class AttributeType(Type):
2625
def isinstance(type: Type) -> bool: ...
2726

2827
@staticmethod
29-
def get(context: Optional[Context] = None) -> AttributeType: ...
28+
def get(context: Context | None = None) -> AttributeType: ...
3029

3130

3231
class OperationType(Type):
3332
@staticmethod
3433
def isinstance(type: Type) -> bool: ...
3534

3635
@staticmethod
37-
def get(context: Optional[Context] = None) -> OperationType: ...
36+
def get(context: Context | None = None) -> OperationType: ...
3837

3938

4039
class RangeType(Type):
@@ -53,12 +52,12 @@ class TypeType(Type):
5352
def isinstance(type: Type) -> bool: ...
5453

5554
@staticmethod
56-
def get(context: Optional[Context] = None) -> TypeType: ...
55+
def get(context: Context | None = None) -> TypeType: ...
5756

5857

5958
class ValueType(Type):
6059
@staticmethod
6160
def isinstance(type: Type) -> bool: ...
6261

6362
@staticmethod
64-
def get(context: Optional[Context] = None) -> ValueType: ...
63+
def get(context: Context | None = None) -> ValueType: ...

mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
from typing import List
65

76
from mlir.ir import Type
87

@@ -94,15 +93,15 @@ class UniformQuantizedPerAxisType(QuantizedType):
9493

9594
@classmethod
9695
def get(cls, flags: int, storage_type: Type, expressed_type: Type,
97-
scales: List[float], zero_points: List[int], quantized_dimension: int,
96+
scales: list[float], zero_points: list[int], quantized_dimension: int,
9897
storage_type_min: int, storage_type_max: int):
9998
...
10099

101100
@property
102-
def scales(self) -> List[float]: ...
101+
def scales(self) -> list[float]: ...
103102

104103
@property
105-
def zero_points(self) -> List[float]: ...
104+
def zero_points(self) -> list[float]: ...
106105

107106
@property
108107
def quantized_dimension(self) -> int: ...

mlir/python/mlir/_mlir_libs/_mlir/dialects/transform/__init__.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
from typing import Optional
65

76
from mlir.ir import Type, Context
87

@@ -12,15 +11,15 @@ class AnyOpType(Type):
1211
def isinstance(type: Type) -> bool: ...
1312

1413
@staticmethod
15-
def get(context: Optional[Context] = None) -> AnyOpType: ...
14+
def get(context: Context | None = None) -> AnyOpType: ...
1615

1716

1817
class OperationType(Type):
1918
@staticmethod
2019
def isinstance(type: Type) -> bool: ...
2120

2221
@staticmethod
23-
def get(operation_name: str, context: Optional[Context] = None) -> OperationType: ...
22+
def get(operation_name: str, context: Context | None = None) -> OperationType: ...
2423

2524
@property
2625
def operation_name(self) -> str: ...

0 commit comments

Comments
 (0)