Skip to content

[FEATURE] Incorrect HTTPVersion type-alias #3821

@antos07

Description

@antos07

Steps to Reproduce

  1. Use ApplicationBuilder().http_version("2") to enable http2, as it said in the docs

Expected behaviour

Type-checkers accept literal '2'

Actual behaviour

Type-checker complains that Literal["1.1", "2.0"] was expected.
image

Operating System

Debian sid

Version of Python, python-telegram-bot & dependencies

python-telegram-bot 20.4
Bot API 6.7
Python 3.11.4 (main, Jun  7 2023, 10:13:09) [GCC 12.2.0]

Relevant log output

No response

Additional Context

In telegram._utils.types it defines HTTPVersion = Literal["1.1", "2.0"]. The correct one will be HTTPVersion = Literal["1.1", "2"].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions