Skip to content

Add "dummy import" to avoid cyclic import #1597

@JimChengLin

Description

@JimChengLin

If I simply want to import some classes to make proper type annotations, why should I deal with cyclic import issue? Cuz, the code involved is kind of "useless" i.e. deletion would not change anything.

So, I proposal that we can have a special mechanism, like from a import A as A.

Do you see the point? import A as A, which is totally meaningless. Anyone who has a brain would not do it and the interpreter will know this import is just for type annotations.

The change is fairly trivial.

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