
On Tue, Jan 19, 2021 at 8:54 AM Larry Hastings <larry@hastings.org> wrote:
On 1/18/21 3:42 PM, Inada Naoki wrote:
Many type hinting use cases don't need type objects in runtime. So I think PEP 563 is better for type hinting user experience.
You mean, in situations where the user doesn't want to import the types, because of heavyweight imports or circular imports? I didn't think those were very common.
Personally, I dislike any runtime overhead caused by type hints. That is one reason I don't use type hinting much for now. I don't want to import modules used only in type hints. I don't want to import even "typing". I planned to use type hinting after I can drop Python 3.6 support and use `from __future__ import annotations`. And I love lightweight function annotation implementation (*) very much. (*) https://github.com/python/cpython/pull/23316 I expect we can start to write type hints even in stdlibs, because it doesn't require extra imports and overhead become very cheap. Maybe, I am a minority. But I dislike any runtime overhead and extra dependencies. Regards, -- Inada Naoki <songofacandy@gmail.com>