Skip to content

detect if __future__.annotations is actually needed #39

Description

@hon-gyu

Currently we seem to include from __future__ import annotations in all cases. But it should only be needed if (1) there are type declarations; and (2) the type declarations contain circular references (?)

  • is the above understanding correct?
  • is there a way to detect if it's needed?
    • one potential way: use ty to typecheck code without and with this import. if it fails without it and passes with it, it should be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions