-
-
Couldn't load subscription status.
- Fork 3k
Closed
Description
I have some PY2+PY3 code that I'm adding mypy type annotations to, but the PY2 runtime environment does not have the typing backport module. The current workaround is to put a try/except around the typing import, but that looks a bit ugly, and even if the environment did have it, or if I were running in PY3, I dont know that I want that imported at runtime.
Can we support some sort of comment-based directive at the top of the file that mypy can parse?
Apologies if this has already been asked, I tried searching but there is a lot to sift through.
Metadata
Metadata
Assignees
Labels
No labels