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

Improve support for imports #122

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tristanlatr
Copy link
Contributor

This PR gives beniget understanding of imports, including relative imports.
Relative imports will be parsed as expected only if beniget is given the module name explicitly when calling DefUseChains(modname="stuff.bar"). If the analyzed module is the __init__.py file of a packages, the argument is_package=True should also be passed to have correct understanding of relative imports.

This version keeps it simple by not trying to deduce the module name from the filename.

@tristanlatr
Copy link
Contributor Author

The support for imports could be useful for QuantStack/memestra#12

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.

1 participant