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

top-level TypeVar not recognised in annotations ("Ambiguous Type" error) #37

Closed anentropic closed 4 years ago

anentropic commented 4 years ago

Bit of an edge case as you would not expect people to be using typing.TypeVar if they only have docstring types...

But I had been doing it anyway since I knew we were going to migrate to real annotations

So ideally we want these recognised as defined types in the current document, same as top-level class defs already are

anentropic commented 4 years ago

it's possible to imagine other cases, dynamically defined types like MyCls = type(...) but, for now, life is too short