8000 Add __path__ to package __init__ by hauntsaninja · Pull Request #9454 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Add __path__ to package __init__ #9454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Inline named_type
This gives us better errors for fixtures stuff and helps with Python 2
  • Loading branch information
hauntsaninja committed Oct 6, 2020
commit 0faa2b8c217dde74f18649e031cb4db3dcabfc8b
7 changes: 6 additions & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,12 @@ def add_implicit_module_attrs(self, file_node: MypyFile) -> None:
continue
# Need to construct the type ourselves, to avoid issues with __builtins__.list
# not being subscriptable or typing.List not getting bound
typ = self.named_type("__builtins__.list", [self.str_type()])
sym = self.lookup_qualified("__builtins__.list", Context())
if not sym:
continue
node = sym.node
assert isinstance(node, TypeInfo)
typ = Instance(node, [self.str_type()])
else:
assert t is not None, 'type should be specified for {}'.format(name)
typ = UnboundType(t)
Expand Down
0