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
In the following code, mypy thinking callable(o) always returns False. This might be related to #3603.
deff(o: object) ->None:
ifcallable(o):
# this branch is not typecheckedo()
1+'boom'# no error from mypyo()
f(lambda: print('hello'))
Here is the output from mypy and python.
$ mypy n.py
$ python3 n.py
hello
Traceback (most recent call last):
File "n.py", line 8, in <module>
f(lambda: print('hello'))
File "n.py", line 5, in f
1 + 'boom'
TypeError: unsupported operand type(s) for +: 'int' and 'str'