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

Let's create a good rule for which parts of the API are pre-imported #92

Open
jonathanhhb opened this issue Dec 3, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@jonathanhhb
Copy link
Collaborator

"It is reasonable and often considered a best practice for Python modules to pre-import public API functions and classes into the init.py file. This approach allows users to access these elements directly from the top-level package (e.g., import mymodule; mymodule.function()), improving usability and intuitiveness, especially for libraries with multiple submodules.

While modern IDEs with autocompletion reduce the need for this practice, pre-importing still offers clear benefits for discoverability and user experience, as users don’t need to navigate submodules or guess where specific functionality resides."

But it does make sense for some API functions to be scoped in a submodule, e.g., the migration math functions. Let's create some rational rule for this so we do as much pre-importing as possible without feeling like it's all very ad hoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants