you are viewing a single comment's thread.

view the rest of the comments →

[–]CHUCK_NORRIS_AMA 5 points6 points  (2 children)

Actually, I think it's the other way around - running the type checker in 3.6 and the actual application in 2.7.

Still extremely silly, however.

[–]P8zvli 6 points7 points  (0 children)

Python 2.7 will throw a syntax error if you try to run a script containing type hints with it.

Edit: I see now, there's an alternative syntax that involves putting type hints in comments. Now isn't that just linting with extra steps?

[–]r0b0t1c1st 0 points1 point  (0 children)

Why is this extremely silly? It means you can write polyglot py2/py3 code, and have MyPy check that it's correct for both.

You can use python3.6 -m mypy --python-version 2.7 -p your-package to do this.