In Tilus and Hidet, we use the following way to define data types:
class IntegerType(DataType):
...
int32 = IntegerType(...)
We use types like int32 as the type hint in the DSL:
class MyKernel(tilus.Script):
def __call__(self, a: int32):
...
IDEs like PyCharm and VSCode will report warning like
Type hint is invalid or refers to the expression which is not a correct type
We need to change the way of defining data types to avoid such warning.
Workaround: to temporarily disable the warning, we can configure the IDE settings.
- For PyCharm:
Settings -> Editor -> Inspections -> Python -> Security -> Unmark "Invalid type hints usage and definitions".