Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python 2/3 version checks #243

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

Closed
JukkaL opened this issue Jul 16, 2013 · 1 comment
Closed

Python 2/3 version checks #243

JukkaL opened this issue Jul 16, 2013 · 1 comment

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 16, 2013

It should be possible to type check code that uses conditional Python version checks.

Consider this code:

if PY3:
    # python 3
    ...
else:
    # python 2
    ...

If type checking in Python 3 mode, we should only type check the if block and ignore the else block, and vice versa in Python 2 mode.

Open questions:

  • How do we determine which flag/constant the code uses to check for Python version?
  • Should we also have special support for six?
@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 24, 2014

Basic implementation in 7b8f721. Refinements in #308.

@JukkaL JukkaL closed this as completed Jul 24, 2014
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

1 participant