Skip to content

[Feature] Make all primitive data types and pointer data types real class #39

@yaoyaoding

Description

@yaoyaoding

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions