clacke: exhausted pixie dream boy 🇸🇪🇭🇰💙💛Yes! Upgrading to latest flake8 (implying latest pyflakes) and removing a bunch of <code># noqa</code> from our codebase.<br><br><a href="https://github.com/PyCQA/pyflakes/pull/479" rel="nofollow noopener" target="_blank">github.com/PyCQA/pyflakes/pull…</a><br><em>Fix false positive with partially quoted annotations</em><br><br>What would happen was that we would have code like:<br><br><pre><code>if TYPE_CHECKING:
from app.resources.blah import Blah
@dataclass
class Thing
blah: Optional["Blah"]</code></pre><br><br>And flake8/pyflakes would complain F401 for unused import, as it didn't realize that Blah was used in the type declaration. With <code>"Blah"</code> it would work, in the cases where you don't use e.g. <code>List[]</code>, <code>Optional[]</code> or <code>Union[]</code>, it would work, and with <code>"Optional[Blah]"</code> it would work too, but I only knew the quote-all-the-things workaround today, on the same day I found the real fix.<br><br>Fewer noqa good.<br><br><a href="https://libranet.de/search?tag=python" rel="nofollow noopener" target="_blank">#python</a> <a href="https://libranet.de/search?tag=pyflakes" rel="nofollow noopener" target="_blank">#pyflakes</a> <a href="https://libranet.de/search?tag=flake8" rel="nofollow noopener" target="_blank">#flake8</a>