sewer
sewer copied to clipboard
add python3 type annotations
use either; https://github.com/Instagram/MonkeyType or https://github.com/dropbox/pyannotate
the instagram one seems better since it doesn't generate type comments.
depends on https://github.com/komuw/sewer/pull/73
I am mildly in favor of Py3 annotations, but dubious about auto-annotate stuff like this. I'd like to see annotations that reflect explicit design choices, not just what's observed in one (or several) test runs. Only mildly in favor because annotations can (and should) be good documentation of design intent, but aren't enforced (generally - is there tooling to do this now, even if it's only suitable for test runs?). Also, haven't Pythons annotations changed somewhat since they were introduced? Well, we already have a clear requirement for 3.3+ for unittest.mock. But variable annotations are much more recently introduced - 3.6, it says here. So what "level" of annotations should we target?
Somewhere in this possibly inconsistent mess of thoughts is my long standing, serious objection to the code is documentation delusion. Oh, there's a grain of truth behind it, but as documentation code is both over-specific and incomplete, since it unavoidably documents the implementation details, and only implies, sometimes not at all clearly, the design intent.