There are some types that need to reference themselves. For instance:
class X():
def some_func() -> X:
...
However, this is NOT valid Python 3 (X has not yet been fully declared at this point). Mypy should have a way for types to self-reference themselves (maybe a ThisType type?).
The current convention is to put it in quotes, e.g.
class X:
def some_func(self) -> 'X':
...
@gvanrossum I wasn't aware of that. Whoops. Closing...
Most helpful comment
The current convention is to put it in quotes, e.g.