In hindsight, applying a static boilerplate to all Python files was far too excessive. It turns out there is full support for gradually integrating modern type-hint syntax via FA^1 instead. As such, this PR only integrates from __future__ import annotations on the files that can take immediate advantage of it:
# Before
from typing import List, Optional, Tuple, Union
def some_function(env: "ForwardDeclaredType") -> Optional[Tuple[List[str], Union[int, float]]]:
# After
from __future__ import annotations
def some_function(env: ForwardDeclaredType) -> tuple[list[str], int | float]] | None:
In hindsight, applying a static boilerplate to all Python files was far too excessive. It turns out there is full support for gradually integrating modern type-hint syntax via
FA
^1 instead. As such, this PR only integratesfrom __future__ import annotations
on the files that can take immediate advantage of it: