Skip to content

Add verbose return type hint to HTTPConnection.json method#1597

Closed
fisher60 wants to merge 1 commit intoKludex:masterfrom
fisher60:documentation/fix-json-type-hint
Closed

Add verbose return type hint to HTTPConnection.json method#1597
fisher60 wants to merge 1 commit intoKludex:masterfrom
fisher60:documentation/fix-json-type-hint

Conversation

@fisher60
Copy link

The original return type hint here, typing.Any, is too vague. A more accurate and specific type hint can be added. Using typing.Dict[str, typing.Any] is more clear as this response should always be JSON, therefore typing.Any is misleading.

Initially raised as discussion #1596

The original return type hint here, `typing.Any`, is too vague. A more accurate and specific type hint can be added. Using `typing.Dict[str, typing.Any]` is more clear as this response should always be JSON, therefore `typing.Any` is misleading.
@Kludex
Copy link
Owner

Kludex commented Apr 21, 2022

As shortly mentioned on #1596 (comment), this PR makes the wrong assumption.

Thanks for the interested tho!

@Kludex Kludex closed this Apr 21, 2022
mgorny added a commit to mgorny/starlette that referenced this pull request Nov 22, 2022
Use a fake "text" Content-Encoding instead of "br"
for test_gzip_ignored_for_responses_with_encoding_set.  The latter
currently fails if an implementation of brotli is actually installed,
since the test uses fake content that is not valid Brotli stream.
Rather than forcing a dependency on Brotli decoder, just use a custom
Content-Encoding that should not yield any implicit processing.

Closes Kludex#1597
azurelotus06 added a commit to azurelotus06/starlette that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants