1w6 uRPG 1w6 uRPG
  • Anmelden
  • Öffentlich

    • Öffentlich
    • Gruppen
    • Beliebt
    • Verzeichnis

http://sn.1w6.org/file/clacke-20200831T063315-8ll2g7s.html

http://sn.1w6.org/file/clacke-20200831T063315-8ll2g7s.html
Yes! Upgrading to latest flake8 (implying latest pyflakes) and removing a bunch of # noqa from our codebase.

github.com/PyCQA/pyflakes/pull…
Fix false positive with partially quoted annotations

What would happen was that we would have code like:

if TYPE_CHECKING:
    from app.resources.blah import Blah


@dataclass
class Thing
    blah: Optional["Blah"]


And flake8/pyflakes would complain F401 for unused import, as it didn't realize that Blah was used in the type declaration. With "Blah" it would work, in the cases where you don't use e.g. List[], Optional[] or Union[], and with "Optional[Blah]" it would work too, but I only knew the quote-all-the-things workaround today, on the same day I found the real fix.

Fewer noqa good.

#python #pyflakes #flake8

Nachrichten, in denen dieser Anhang erscheint

  1. clacke clacke

    Yes! Upgrading to latest flake8 (implying latest pyflakes) and removing a bunch of # noqa from our codebase.github.com/PyCQA/pyflakes/pull…Fix false positive with partially quoted annotationsWhat would happen was…

    Monday, 31-Aug-20 06:01:04 UTC
  • Hilfe
  • Über
  • FAQ
  • AGB
  • Privatsphäre
  • Quellcode
  • Version
  • Kontakt

1w6 uRPG ist ein Mikrobloggingdienst von Arne (Drak) Babenhauserheide. Es wird mit der Mikrobloggingsoftware StatusNet (Version 1.1.1-release) betrieben, die unter der GNU Affero General Public License erhältlich ist. The running version includes the patches from draketo.de/proj/statusnet-patches.

Creative Commons Attribution 3.0 Alle Inhalte und Daten von 1w6 uRPG sind unter der Creative Commons Attribution 3.0 Lizenz verfügbar.