Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add python3 type annotations #78

Open
komuw opened this issue Mar 6, 2018 · 2 comments
Open

add python3 type annotations #78

komuw opened this issue Mar 6, 2018 · 2 comments

Comments

@komuw
Copy link
Owner

komuw commented Mar 6, 2018

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.

@komuw
Copy link
Owner Author

komuw commented Mar 6, 2018

depends on #73

@mmaney
Copy link
Collaborator

mmaney commented Mar 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants