Skip to content

Sub-Optiomal type hints in ConversationHandler #3665

@klim-neumann

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy