-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TYPE_CHECKING
doesn't work if imported with alias
#12928
Comments
it also doesn't care if i define a fake TYPE_CHECKING = False
if not TYPE_CHECKING:
1 + "" # no error even though this is reachable at runtime |
This comment was marked as off-topic.
This comment was marked as off-topic.
I think that's probably a remnant of when you couldn't import That behavior could be considered a feature if you wanted to be able to add types to Python 2 code without having to install the typing backport, but, judging from #12237, we're probably fine making breaking changes for Python 2 users. |
playground
The text was updated successfully, but these errors were encountered: