Skip to content

Conversation

r3m0t
Copy link
Contributor

@r3m0t r3m0t commented May 18, 2019

Two ways to do this:

  1. Resolve relative imports at compile time like this
  2. Defer to pyimport_importmodulelevelobject, so theoretically a package using entirely relative imports can be movied around so that it's importable under a different path.

I implemented the second, but it was excessively complicated and didn't provide any benefit, as I'm pretty sure the typechecking results rely on the module being under the usual path, so switched to this.

@r3m0t
Copy link
Contributor Author

r3m0t commented May 18, 2019

Closes #576

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like the right choice here to me, yeah.

This all seems solid. Thanks!

@msullivan msullivan merged commit 5d61f19 into mypyc:master May 20, 2019
@r3m0t r3m0t deleted the relative-imports-b branch May 21, 2019 06:48
msullivan pushed a commit to python/mypy that referenced this pull request Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants