Closed
Description
This works:
# test.py
import os
print('PWD: {}'.format(os.environ.get('PWD', '<not set>')))
$ python --version
Python 2.7.13
$ python test.py
PWD: …
$ python3 --version
Python 3.6.0
$ python3 test.py
PWD: …
$ mypy test.py
$ mypy --py2 test.py
This fails validation with --py2
:
# test_unicode_literals.py
from __future__ import unicode_literals # this is new
import os
print('PWD: {}'.format(os.environ.get('PWD', '<not set>')))
$ python test_unicode_literals.py
PWD: …
$ python3 test_unicode_literals.py
PWD: …
$ mypy test_unicode_literals.py
$ mypy --py2 test_unicode_literals.py
test_unicode_literals.py:3: error: No overload variant of "get" of "Mapping" matches argument types [builtins.unicode, builtins.unicode]
Metadata
Metadata
Assignees
Labels
No labels