Skip to content
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

Provide redirect functionality for shadows imports #130

Open
CJ-Wright-Citadel opened this issue Jun 23, 2021 · 0 comments
Open

Provide redirect functionality for shadows imports #130

CJ-Wright-Citadel opened this issue Jun 23, 2021 · 0 comments

Comments

@CJ-Wright-Citadel
Copy link
Contributor

For instance, python's os.path is actually either posixpath or ntpath. Either way os.path.basename doesn't exist, since os.path shadows another module.

We need something that knows if you can't find the full symbol name and if part of the symbol's qualified name is a shadows import to check that shadows import for the symbol.

Eg.
os.path.basename -> os.path -> posixpath -> posixpath.basename

I don't think the code has the data structure to support this, since the symbol table is not capable of de-referencing. This means that the code would need to do the de-referencing ahead of time, but this could result in massive duplication of data, since now every module that is imported will have it's contents unloaded. This could be quite the a lot of symbols if someone did this with numpy, for instance. Or we need to make a new table that helps to dereference the symbols, providing mappings for all potential de-references. The downside of this approach is that we wouldn't have a way to tag a de-reference entry to a particular version of the package, since some versions may not have the needed pointers.

@dacamo76 what do you think?

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

No branches or pull requests

1 participant