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
~/src 12:38:46 $ python3 foo.py
Traceback (most recent call last):
File "foo.py", line 1, in <module>
class A(object):
File "foo.py", line 3, in A
y = [x + 1 for _ in range(10)]
File "foo.py", line 3, in <listcomp>
y = [x + 1 for _ in range(10)]
NameError: name 'x' is not defined
~/src 12:38:55 $ python foo.py
~/src 12:38:57 $ mypy -2 foo.py
foo.py:3: error: Name 'x' is not defined
Expected behavior: the code should typecheck in py2 mode.
ETA: version 0.550; apologies if this is fixed. (Confirmed on 0.630.)
The text was updated successfully, but these errors were encountered:
This code is legal in Python 2:
It seems not to be legal in Python 3.
However, even with
-2
, mypy does not allow it:Expected behavior: the code should typecheck in py2 mode.
ETA: version 0.550; apologies if this is fixed. (Confirmed on 0.630.)
The text was updated successfully, but these errors were encountered: