We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e632fea commit 0faa2b8Copy full SHA for 0faa2b8
mypy/semanal.py
@@ -405,7 +405,12 @@ def add_implicit_module_attrs(self, file_node: MypyFile) -> None:
405
continue
406
# Need to construct the type ourselves, to avoid issues with __builtins__.list
407
# not being subscriptable or typing.List not getting bound
408
- typ = self.named_type("__builtins__.list", [self.str_type()])
+ sym = self.lookup_qualified("__builtins__.list", Context())
409
+ if not sym:
410
+ continue
411
+ node = sym.node
412
+ assert isinstance(node, TypeInfo)
413
+ typ = Instance(node, [self.str_type()])
414
else:
415
assert t is not None, 'type should be specified for {}'.format(name)
416
typ = UnboundType(t)
0 commit comments