This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rav
Recipients docs@python, rav
Date 2017-04-03.17:32:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation of typing.TYPE_CHECKING has an example (introduced in issue #26141) that would lead to NameError at runtime. The example shows how to limit the import of "expensive_mod" to type checkers, but then goes on to use "expensive_mod.some_type" in a type annotation that is evaluated at runtime ("local_var: expensive_mod.some_type"). The use case of TYPE_CHECKING is probably meant for type annotations placed in comments, e.g. "local_var  # type: expensive_mod.some_type".
History
Date User Action Args
2017-04-03 17:32:43ravsetrecipients: + rav, docs@python
2017-04-03 17:32:43ravsetmessageid: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za>
2017-04-03 17:32:43ravlinkissue29974 messages
2017-04-03 17:32:43ravcreate