Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ddfisher up there is already talking about stuff like

----

It should work with the Python 3 syntax if you quote your type annotation. I.e.

  def f() -> "Bar": ...
instead of

  def f() -> Bar: ...
---

Yeah, you need to write `from typing import List` to get the generic List class that you can parameterize with an item type. As you pointed out, you can use the builtin lowercase-l list without importing anything, but that doesn't allow you to specify the item type.

---

imo, this is brutal. I'll just wait and see whether I'm proven right or wrong, but the extremely poor aesthetics of the whole thing bode badly.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: