dropbox / pyannotate

Auto-generate PEP-484 annotations
Apache License 2.0
1.42k stars 59 forks source link

Support for getting annotations from dmypy suggest #100

Open chadrik opened 4 years ago

chadrik commented 4 years ago

I would love if pyannotate could fall back to dympy suggest if no type info is found for a function. I'd be happy to submit a PR for this (I've already created a prototype that works as expected).

If you'd rather do something more abstract/configurable, this could be implemented as a shell command to run as a fallback:

pyannotate --signature-cmd='dmypy suggest --json {filename}:{lineno}'  file1
gvanrossum commented 4 years ago

Maybe @msullivan can answer this? IIRC we built a prototype of something that tied dmypy suggest and pyannotate together, using the output from dmypy suggest and piping it into the second half of pyannotate. But I don't recall the details and I don't remember if we ever released this in public or if it was just a Dropbox internal experiment. I do think you're close in suggesting that there's a connection!