Skip to content

Commit df1bb53

Browse files
committed
Remove invalid return type annotation from http_request method
The annotation was invalid, resulting in mypy error: error: "dict" expects 2 type arguments, but 1 given [type-arg] The `headers` field of the dictionary returned by this function is a `http.client.HTTPMessage` class object, while the other field values are strings. I didn't find a way to specify this in a return type annotation and the current approach is to provide annotations on a "best effort" basis (vs making them universally mandatory) so I settled on removing the annotation entirely.
1 parent da55457 commit df1bb53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reportsizedeltas/reportsizedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def get_json_response(self, url: str):
581581
except Exception as exception:
582582
raise exception
583583

584-
def http_request(self, url: str, data: str | None = None) -> dict[str]:
584+
def http_request(self, url: str, data: str | None = None):
585585
"""Make a request and return a dictionary:
586586
read -- the response
587587
info -- headers

0 commit comments

Comments
 (0)