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 d687e71 commit d765cdfCopy full SHA for d765cdf
mypy/semanal.py
@@ -405,7 +405,13 @@ 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
+ # typ = self.named_type("__builtins__.list", [self.str_type()])
415
else:
416
assert t is not None, 'type should be specified for {}'.format(name)
417
typ = UnboundType(t)
0 commit comments