Skip to content
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

Maybe MYPY, PY2 and PY3 can be imported from typing instead of having to set them? #308

Closed
gvanrossum opened this issue Jul 19, 2014 · 3 comments

Comments

@gvanrossum
Copy link
Member

I have to write code like this:

MYPY = False
if MYPY:
   # do mypy stuff

I think it would be more elegant if I could write

from typing import MYPY

instead. That way the values can actually be defined properly in the stubs and lib-typing files.

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 23, 2014

Yeah, that's a good idea.

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 21, 2015

MYPY doesn't make sense any more in the context of PEP 484.

@JukkaL
Copy link
Collaborator

JukkaL commented May 31, 2015

typing.PY2 and typing.PY3 were removed from PEP 484. We should detect runtime Python version checks instead. Created #698 to supercede this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants