Skip to content

Sub-Optiomal type hints in ConversationHandler #3665

Description

@klim-neumann

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]]?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions