You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bad typing for Python 2.7 with unicode_literals #5098
On Tue, May 22, 2018, 18:25 Ilya Konstantinov ***@***.***> wrote:
Consider:
from __future__ import unicode_literalsimport sys
print(sys.modules['sys'])
mypy --py2 unicode_literals.py results in:
unicode_literals.py:4: error: Invalid index type "unicode" for "Dict[str, Any]"; expected type "str"
However, python2.7 unicode_literals.py results in:
<module 'sys' (built-in)>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5098>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMoeZNPfQ5wVeufJE9eiWTZP6daDfks5t1LqigaJpZM4UJoIb>
.
I believe mypy currently doesn't support unicode_literals: there's some related discussion here and here.
Maybe there's an opportunity to do some usability enhancement here? If we're not planning on supporting unicode_literals any time soon, maybe we can have mypy report a warning when it detects some code using it/link to something in the docs.
On Tue, May 22, 2018, 19:09 Michael Lee ***@***.***> wrote:
I believe mypy currently doesn't support unicode_literals: there's some
related discussion here <#3619> and
here <#2536>.
Maybe there's an opportunity to do some usability enhancement here? If
we're not planning on supporting unicode_literals any time soon, maybe we
can have mypy report a warning when it detects some code using it/link to
something in the docs.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5098 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMgXTaepPwT0aDgb-26nnGUhWCblMks5t1MTcgaJpZM4UJoIb>
.
Activity
gvanrossum commentedon May 23, 2018
Michael0x2a commentedon May 23, 2018
I believe mypy currently doesn't support unicode_literals: there's some related discussion here and here.
Maybe there's an opportunity to do some usability enhancement here? If we're not planning on supporting unicode_literals any time soon, maybe we can have mypy report a warning when it detects some code using it/link to something in the docs.
gvanrossum commentedon May 23, 2018
ilevkivskyi commentedon Dec 30, 2018
This is essentially a duplicate of #2536, so I am closing this one.