Skip to content

f821

1 posts ◉ feed
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.
Read more →
@ideal-rain-33