Skip to content

Add exemption to Python styleguide import for exposing classes in __init__.py and unify formatting of the Table of Contents #918

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

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

Martian-0007
Copy link

I have been recently working on a project and found that you can expose a Class in __init__.py using:

from package.module import Class

This can later be used for simpler imports, such as:

from package import Class
# Instead of
from package.module import Class

However, the Google guide states:

Use import statements for packages and modules only, not for individual types, classes, or functions.
Allowing this specific instance of individual class import would be beneficial, as it significantly simplifies the workflow.

…and unify formatting of Table of Contents

Signed-off-by: Martin <81148675+Martian-0007@users.noreply.github.com>
@vapier vapier added the lang:python The Python language label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:python The Python language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants