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

Skip to content

Python 2/3 version checks #243

Closed
Closed
@JukkaL

Description

@JukkaL

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions