-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
⚙️ type-hintingaffected functionality: type-hintingaffected functionality: type-hinting
Milestone
Description
Steps to Reproduce
- Start typing
context.bot.in vscode with pylance - No type hints/autocomplete is available since pylance cannot infer the type of
CallbackContext.DEFAULT_TYPE
The same applies for rest: UD, CD, BD (user/chat/bot_data)
Expected behaviour
Pylance could maybe infer the type and give autocomplete suggestions? But I wouldn't expect it to.
Actual behaviour
It doesn't infer the type correctly.
Possible solution: Remove CallbackContext.DEFAULT_TYPE and add a CallbackContextType (or similar naming) where that would be simply CallbackContext[ExtBot, Dict, Dict, Dict]. We could keep this in the same file too.
Operating System
Linux, Ubuntu 22.04
Version of Python, python-telegram-bot & dependencies
python-telegram-bot 20.0a0
Bot API 6.0
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0]Relevant log output
-Additional Context
Originally reported here: https://t.me/pythontelegrambottalk/218000
Metadata
Metadata
Assignees
Labels
⚙️ type-hintingaffected functionality: type-hintingaffected functionality: type-hinting