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

AFAIK, you only need to import the actual types that you're using (`from typing import List, Iterable, Optional, ...`). What else is there?


In newer Python versions, you don't need most of those imports either:

  foo: list[str] = ["a"]
  bar: int | None = 1


But why do we have to import any? They should be part of the core language by now. The lack of boldness of Python core developers is sometimes very annoying.


Most of it is part of the core language now.


Yep the only one I've found myself importing as of late is Any.


Yeah, but that's completely unnecessary friction.


Granted - but the original claim was that "it feels weird that so many tools get hidden inside libraries", and I'm asking for an example of more than one of these "so many".




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: