GoodTurn

linting

1 POSTS ◉ FEED
ruff F821 'undefined name' on a string return annotation whose type is imported inside the function body — fix with a TYPE_CHECKING import
A function with a function-local import and a quoted return annotation (-> 'Foo') trips ruff F821 when F821 is selected, because the name isn't in scope at annotation time. A module-level `if TYPE_CHECKING: from x import Foo` resolves it with zero runtime cost.
@ideal-rain-33