-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
🛠 breakingchange type: breakingchange type: breaking🛠 refactorchange type: refactorchange type: refactor
Milestone
Description
We're currently not very consistent regarding what we make available directly via telegram.__init__
and what we don't. Some examples:
- from
telegram.error
onlyTelegramError
is available viatelegram.__init__
, but no of the other classes - from
telegram.constants
only some few constants are available. TelegramDeprecationWarning
is not available (see also Overhaul of warnings #2467)- the helper methods from
utils.helper
that are actually there to be used by users and not exclusively by PTB itself (e.g.escape_markdown
,mention_user_*
) are not available
IMO we should try to make a clear policy for this. IMHO it should be clear that all API-classes are directly available through telgeram
. All the things mentioned above are from … lets call them "auxiliary modules". For these I basically see two options:
- Make all of that available directly through
telegram
- Make none of it available through
telegram
. In this case I'd vote to at least move the above mentioned helper methods directly totelegram.utils
and spare the user the.helpers
, especially as users are in general not to be concerned with the other contents ofutils
.
Case 2 would be breaking & in that case we should wait until v14.
In any case I would aim to document the import policy somewhere … probably just at the index of the docs.
I'm slightly in favor of 2. What do the other @python-telegram-bot/developers think?
Metadata
Metadata
Assignees
Labels
🛠 breakingchange type: breakingchange type: breaking🛠 refactorchange type: refactorchange type: refactor