Skip to content
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

Sub-Optiomal type hints in ConversationHandler #3665

Closed
klim-neumann opened this issue Apr 16, 2023 · 3 comments
Closed

Sub-Optiomal type hints in ConversationHandler #3665

klim-neumann opened this issue Apr 16, 2023 · 3 comments
Labels
type hinting Not bug. Not Docs. But both.

Comments

@klim-neumann
Copy link

Steps to Reproduce

  1. Сreate an instance of the CallbackQueryHandler class
  2. Create an instance of the ConversationHandler class with entry_points that contains the instance from the first step

Expected behaviour

Type checking should pass without errors

Actual behaviour

Type checking throws an error:

Argument of type "list[CallbackQueryHandler[DEFAULT_TYPE]]" cannot be assigned to parameter "entry_points" of type "List[BaseHandler[Update, CCT@ConversationHandler]]"

Operating System

MacOS 12.6.5

Version of Python, python-telegram-bot & dependencies

python-telegram-bot 20.2
Bot API 6.6
Python 3.11.2 (main, Apr 15 2023, 18:09:35) [Clang 14.0.0 (clang-1400.0.29.202)]

Relevant log output

No response

Additional Context

ConversationHandler entry_points should be Sequence[BaseHandler[Update, CCT]] instead of List[BaseHandler[Update, CCT]]?

@Bibo-Joshi
Copy link
Member

Hi. To clarify: This is not about runtime behavior but about sub-optimal type hints, right?

@klim-neumann
Copy link
Author

yes, that's right.

@Bibo-Joshi Bibo-Joshi added type hinting Not bug. Not Docs. But both. and removed bug 🐛 labels Apr 16, 2023
@Bibo-Joshi Bibo-Joshi changed the title Type checking error Sub-Optiomal type hints in ConversationHandler Apr 16, 2023
@Bibo-Joshi
Copy link
Member

Okay. Thanks for pointing it out. Overhauling CH is a big item on the roadmap.
I'm adding it to the (long) list in #2770 and will close this issue in favor of #2770 :)

@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type hinting Not bug. Not Docs. But both.
Projects
None yet
Development

No branches or pull requests

2 participants