-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case.
from collections import namedtuple
HeData = namedtuple("HeData", "run cell scale dt fid t1")
the traceback is:
/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'CodeType'
/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'FrameType'
/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'TracebackType'
types.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521
Traceback (most recent call last):
File "/home/adam/.local/bin/mypy", line 11, in <module>
sys.exit(console_entry())
File "/home/adam/.local/lib/python3.6/site-packages/mypy/__main__.py", line 7, in console_entry
main(None)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/main.py", line 50, in main
res = type_check_only(sources, bin_dir, options)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/main.py", line 97, in type_check_only
options=options)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/build.py", line 196, in build
graph = dispatch(sources, manager)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/build.py", line 1801, in dispatch
process_graph(graph, manager)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/build.py", line 2044, in process_graph
process_stale_scc(graph, scc, manager)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/build.py", line 2139, in process_stale_scc
graph[id].semantic_analysis()
File "/home/adam/.local/lib/python3.6/site-packages/mypy/build.py", line 1696, in semantic_analysis
self.manager.semantic_analyzer.visit_file(self.tree, self.xpath, self.options, patches)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 295, in visit_file
self.accept(d)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 3645, in accept
node.accept(self)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/nodes.py", line 859, in accept
return visitor.visit_assignment_stmt(self)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 1581, in visit_assignment_stmt
self.process_namedtuple_definition(s)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 2126, in process_namedtuple_definition
named_tuple = self.check_namedtuple(s.rvalue, name)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 2162, in check_namedtuple
info = self.build_namedtuple_typeinfo(name, items, types, {})
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 2275, in build_namedtuple_typeinfo
info = self.basic_new_typeinfo(name, fallback)
File "/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py", line 2251, in basic_new_typeinfo
info.mro = [info] + basetype_or_fallback.type.mro
TypeError: can only concatenate list (not "NoneType") to list