Closed
Description
On the following page:
It is mentioned:
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.
Metadata
Metadata
Assignees
Labels
No labels