22 Jan
2016
22 Jan
'16
11:19 a.m.
On Fri, Jan 22, 2016, at 14:08, Guido van Rossum wrote:
In mypy (and in typeshed and in typing.py), 'str' refers to the type named str in the Python version for which you are checking -- i.e. by default mypy checks in PY3 mode and str will be the unicode type; but "mypy --py2" checks in PY2 mode and str will be the Python 2 8-bit string type. (This is actually the only thing that makes sense IMO.)
Why should it need to check both modes separately? Does it not work at a level where it can see if the expression that a value originates from is "native" (e.g. a literal with no u/b) or bytes/unicode?