I'm trying to use Python 3's type hinting syntax, along with the MyPy static type checker. I'm now writing a function that takes a requests
response object, and I'm wondering how to indicate the type.
That is to say, in the following piece of code, what can I replace ???
with?
import requests
def foo(request: ???) -> str:
return json.loads(request.content)['some_field']
r = requests.get("my_url")
return foo(r)