Doesn't explicitly setting it yourself still work? ``` TYPE_CHECKING = False
if TYPE_CHECKING: import xxx # modules used only in type hints. ``` This seems to work for mypy, at least. Even just doing `if False:` works correctly (and is arguably the most efficient at runtime). _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/P5W5ETPGVXN47OW27RICUQQRJZCBVFKQ/ Code of Conduct: http://python.org/psf/codeofconduct/