[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The example is actually correct; I just confirmed by running it in my shell. Type annotations on local variables are not evaluated at runtime; see PEP 526. -- nosy: +Jelle Zijlstra ___ Python tracker

[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> patch review type: enhancement -> behavior versions: -Python 3.4 ___ Python tracker ___ ___

[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Mathias Rav
Changes by Mathias Rav : -- pull_requests: +1155 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Mathias Rav
New submission from Mathias Rav: 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