-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Is your feature request related to a problem? Please describe.
Currently all the modules like telegram.{message, chat, user, …}
look like they are public. However, we don't consider them to be part of the public API and they should not be treated as such by the user. The only thing that we guarantee to work is from telegram import Message, Chat, User, …
and not from telegram.message import Message
.
Describe the solution you'd like
Rename all the private modules with a leading underscore, i.e. all files that contain classes that are imported in the __init__
.
This is in accordance with PEP8:
Even with
__all__
set appropriately, internal interfaces (packages, modules, classes, functions, attributes or other names) should still be prefixed with a single leading underscore.
this should also be done for the telegram.ext
package except for the module telegram.ext.filters
. The packages telegram(.ext).utils
should also be renamed to telegram(.ext)._utils
and dropped from the documentation - unless this leads to pre-commit complaining about importing private packages. If it does, we'll have to re-evaluate.
Additional context
- This can be seen as extension of Clear up imports policy #2468
- A PR for Refactor how InputMedia* subclasses handle inits #2573 will likely introduce a new module. Depending on which issue get's resolved by a PR first, the other one will have to adapt to the changes.