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
The following code produces a NotImplementedError using Python 3.5.2 and mypy 0.4.2-dev (commit commit e7e9c4a):
from typing import Any, List, Optional, Tuple
def count(items: Optional[List[Any]]) -> Tuple[int, str]:
"""Return item count and English singular/plural ('' or 's')."""
if not items:
return 0, 's'
count = len(items)
return count, '' if count == 1 else 's'
items = [1, 2, 3]
print('{0} items{1}'.format(*count(items)))
Here is the command line and stack dump:
$ mypy --disallow-untyped-defs --disallow-untyped-calls mypy-failure.py
Traceback (most recent call last):
File "/Volumes/Research/python35-venv/bin/mypy", line 6, in <module>
main(__file__)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/main.py", line 54, in main
res = type_check_only(sources, bin_dir, options)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/main.py", line 102, in type_check_only
python_path=options.python_path)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/build.py", line 209, in build
dispatch(sources, manager)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/build.py", line 1329, in dispatch
process_graph(graph, manager)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/build.py", line 1460, in process_graph
process_stale_scc(graph, scc)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/build.py", line 1490, in process_stale_scc
graph[id].type_check()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/build.py", line 1309, in type_check
manager.type_checker.visit_file(self.tree, self.xpath)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 424, in visit_file
self.accept(d)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 465, in accept
typ = node.accept(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/nodes.py", line 729, in accept
return visitor.visit_expression_stmt(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 1570, in visit_expression_stmt
self.accept(s.expr)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 465, in accept
typ = node.accept(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/nodes.py", line 1185, in accept
return visitor.visit_call_expr(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 1993, in visit_call_expr
return self.expr_checker.visit_call_expr(e)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 141, in visit_call_expr
return self.check_call_expr_with_callee_type(callee_type, e)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 192, in check_call_expr_with_callee_type
e.arg_names, callable_node=e.callee)[0]
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 235, in check_call
callee, args, arg_kinds, formal_to_actual)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 330, in infer_arg_types_in_context2
res[ai] = self.accept(args[ai], callee.arg_types[i])
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 1491, in accept
return self.chk.accept(node, context)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 465, in accept
typ = node.accept(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/nodes.py", line 1185, in accept
return visitor.visit_call_expr(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checker.py", line 1993, in visit_call_expr
return self.expr_checker.visit_call_expr(e)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 141, in visit_call_expr
return self.check_call_expr_with_callee_type(callee_type, e)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 192, in check_call_expr_with_callee_type
e.arg_names, callable_node=e.callee)[0]
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 226, in check_call
lambda i: self.accept(args[i]))
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mypy/checkexpr.py", line 1589, in map_actuals_to_formals
raise NotImplementedError()
NotImplementedError:
*** INTERNAL ERROR ***```
The text was updated successfully, but these errors were encountered:
scott-ainsworth
changed the title
Crash unpacking function return in argument list
Crash unpacking tuple in argument list
Jul 3, 2016
The following code produces a NotImplementedError using Python 3.5.2 and mypy 0.4.2-dev (commit commit e7e9c4a):
Here is the command line and stack dump:
The text was updated successfully, but these errors were encountered: