This tells python to treat type annotations as strings instead of evaluating them on import. In practice, this means two things: we don't have to quote our type annotations, and we can use syntax from newer python versions that is more concise (ie, A | B instead of Union[A, B] or A | None instead of Optional[A], list[A] instead of from typing import List; List[A]). This behavior will become standard in a future version as well. Ruff will automatically add this line to files in new commits to maintain consistency.
This tells python to treat type annotations as strings instead of evaluating them on import. In practice, this means two things: we don't have to quote our type annotations, and we can use syntax from newer python versions that is more concise (ie,
A | B
instead ofUnion[A, B]
orA | None
instead ofOptional[A]
,list[A]
instead offrom typing import List; List[A]
). This behavior will become standard in a future version as well. Ruff will automatically add this line to files in new commits to maintain consistency.Related PEP: https://peps.python.org/pep-0563/