[Python-Dev] Concurrent.futures: no type discovery for PyCharm (original) (raw)

Guido van Rossum guido at python.org
Tue Apr 23 15:43:54 EDT 2019


The general solution is

import typing if typing.TYPE_CHECKING:

The hack of starting with

TYPE_CHECKING = False

happens to work but is not endorsed by PEP 484 so is not guaranteed for the future.

Note that 3rd party code is rarely in such a critical part for script startup that the cost of import typing is too much. But the stdlib often is in the critical path for script startup, and some consider the time spent in that import too much (startup time should be in the order of tens of msec so every msec counts -- but once you start importing 3rd party code you basically can't make it that fast regardless).

Anyway, the stdlib should almost never be used as an example for non-stdlib code -- there are many reasons for this that I don't want to have to repeat here.

On Tue, Apr 23, 2019 at 12:33 PM Ilya Kamenshchikov < ikamenshchikov at gmail.com> wrote:

--Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20190423/f294e5a9/attachment.html>



More information about the Python-Dev mailing list