-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[FEATURE] Incorrect HTTPVersion type-alias #3821
Comments
And I would like to fix it |
Hey! Thanks for the catch! I would say it would make more sense to fix the docstring of AppBuilder.http_version. I think it's nice to have uniformity of version formats. |
OTOH, I do see that HTTP 2.0 is now called HTTP/2, so maybe you're right that the literal too should have the members "1.1" and "2". Let's see what others think :) |
yeah, we should add "2" to the list, i.e. "1.1", "2.0" and "2" |
Well, in fact, "2.0" isn't a valid argument and HTTPXRequest throws an exception, when I use it |
That would ofc also have to be adapted :) Would you maybe like to send a PR yourself? If so, please be sure to check out our contribution guide (linked in the PR template and in the sidebar on docs.python-telegram-bot.org). |
Okay, I just went ahead with it 😄 #3823 |
Steps to Reproduce
ApplicationBuilder().http_version("2")
to enable http2, as it said in the docsExpected behaviour
Type-checkers accept literal '2'
Actual behaviour
Type-checker complains that Literal["1.1", "2.0"] was expected.
Operating System
Debian sid
Version of Python, python-telegram-bot & dependencies
Relevant log output
No response
Additional Context
In
telegram._utils.types
it definesHTTPVersion = Literal["1.1", "2.0"]
. The correct one will beHTTPVersion = Literal["1.1", "2"]
.The text was updated successfully, but these errors were encountered: