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

Specify __all__ in __init__.py #71

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Conversation

BrianPugh
Copy link
Collaborator

Allows for better autocompletion in IDEs. Also substantially reduces namespace pollution for people that (poorly) use from littlefs import *.

@BrianPugh BrianPugh force-pushed the init-all branch 2 times, most recently from a9083f6 to 8ff3b8d Compare December 8, 2023 03:37
@BrianPugh
Copy link
Collaborator Author

@jrast what do you think of this? I set __all__ so that autocomplete can pick up the API better, and I also flattened out the namespace for all the major classes to meet what a user would expect (mostly for type annotations). I didn't do it for the c-style API, since that's intended to be used as from littlefs import lfs.

@jrast
Copy link
Owner

jrast commented Dec 9, 2023

I'm fine with this change! I think this would make the public interface more clear. If there are some examples in the docs importing form some subpackage / module, the examples should also be updated.

@BrianPugh BrianPugh merged commit ca62f9a into jrast:master Dec 11, 2023
12 checks passed
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