anentropic / python-waterloo

A cli tool to convert type annotations found in 'Google-style' docstrings into mypy py2 type comments (and from there into py3 type annotations).
2 stars 0 forks source link

Introspect mystery types #10

Closed anentropic closed 4 years ago

anentropic commented 4 years ago

This PR contains several major refactors

Then main goal was to identify types which are already imported, or which are local class defs and don't need import, or where there is a name clash to provide configurable resolution strategies (e.g. annotate and ignore, annotate and warn, or error and don't annotate)

Along the way we identified an issue in Bowler library when handling Py2 code with print statements (currently using own fork) as well as our own code being broken when running on non-3.7-compatible src files due to use of stdlib ast module (now using parso lib)

All this stuff is now working, with tests

(not sure why I am making gratuitous use of the royal "we" here...)