News for hackers. Stuff that matters.
Re:Static types in Python by weberc2 on Thursday October 13, 2016 @04:37PM (#12703839)
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#impo...
Re:Static types in Python by ddfisher on Thursday October 13, 2016 @05:43PM (#12704309)
It 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.