Skip to content

[DISCUSSION] Adding public submodules to __all__ #2763

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
harshil21 opened this issue Nov 4, 2021 · 0 comments
Closed

[DISCUSSION] Adding public submodules to __all__ #2763

harshil21 opened this issue Nov 4, 2021 · 0 comments
Milestone

Comments

@harshil21
Copy link
Member

harshil21 commented Nov 4, 2021

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

Currently, in the v14 branch we for e.g do: from telegram import error. But if a user does from telegram import *, it does not import the public submodule error, when it should.

PEP-8 says that documented interfaces are considered public and "To better support introspection, modules should explicitly declare the names in their public API using the __all__ attribute.".

Additionally, PEP-8 also says that __all__ should be placed above the imports.

Describe the solution you'd like

Import and add public submodules to __all__, place __all__ above imports.

Additional context

Original discussion: #2759 (comment)

@harshil21 harshil21 added this to the v14 milestone Nov 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants