3 ms·
Why doesn't the import cycle trick work with the Python 3 syntax? This doc seems to suggest that it should: http://mypy.readthedocs.io/en/latest/common_issues.h
by weberc2 10y ago
Why doesn't the import cycle trick work with the Python 3 syntax? This doc seems to suggest that it should: http://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles http://mypy.readthedocs.io/en/latest/common_issues.html#impo...
- ddfisher 10y agoIt should work with the Python 3 syntax if you quote your type annotation. I.e. def f() -> "Bar": ... instead of def f() -> Bar: ... (This is normally used for forward references.) This makes it slightly less nice, but not a terrible workaround overall.