You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update docs for "Import cycles" to refer to TYPE_CHECKING #2178
It is possible that in the future, mypy will change its dead code analysis and this trick will stop working. We will then offer an alternative, e.g. a constant defined by the typing module that is False at runtime but True while type checking.
The aforementioned constant now exists in the form of typing.TYPE_CHECKING. It might be useful to update the docs to refer to it, including in the example.
I could put a docs patch together if this is the correct approach.
Activity
gvanrossum commentedon Sep 24, 2016
davidfstr commentedon Sep 25, 2016
PR: #2181
ddfisher commentedon Sep 27, 2016
Fixed by #2181.