Skip to content

Respect __all__ in modules #978

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

Closed
Jongy opened this issue May 14, 2019 · 3 comments
Closed

Respect __all__ in modules #978

Jongy opened this issue May 14, 2019 · 3 comments
Labels
C-compat A discrepancy between RustPython and CPython

Comments

@Jongy
Copy link
Contributor

Jongy commented May 14, 2019

Importing a module doesn't respect its __all__ list, and all names are imported regardless of its content.

Perhaps it's solved with #958, I don't fully understand what role importlib is gonna take. Anyway since I see CPython has some handling of __all__ in its C side, I guess we'll need in the Rust side as well.

@BenLewis-Seequent
Copy link

importlib does so some handling of __all__, to ensure everything mentioned in __all__ is imported(https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap.py#L1036). But most of the handling will need to be done in Rust to populate the current scope with everything mentioned within __all__.

@coolreader18 coolreader18 added the C-compat A discrepancy between RustPython and CPython label Jun 9, 2019
@dralley
Copy link
Contributor

dralley commented Dec 21, 2020

Is this work finished or is there something left to do? The PR only says "Relates to issue #978"

@coolreader18
Copy link
Member

I think this should be done, yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants