Skip to content

Add an option to automatically add from __future__ import annotations when needed #618

@abey79

Description

@abey79

I recently realised how from __future__ import annotations enables modern type hint while retaining compatibility with older Python version (I currently target 3.8+ with my project). Using pyupgrade helped a great deal to bring everything up to date, but I still had to manually add from __future__ import annotations in every file. It would be great if pyugrade had an option to do the work for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions