Describe the bug
The ClientSession class allows you to specify a response_class which is then used for responses in place of ClientResponse when handling responses. However the typings are not generic, they are hard coded to use ClientResponse so custom aspects of the response_class result in type errors.
To Reproduce
- Add a custom
response_class
- Use a request method on a
ClientSession, e.g. client.post()
- The
response_class in 1 will be used, but it will still be typed as the default ClientResponse
Expected behavior
Use the response_class type in typings.
Versions
python=3.10.8
aiohttp=3.8.3
Code of Conduct
Describe the bug
The
ClientSessionclass allows you to specify aresponse_classwhich is then used for responses in place ofClientResponsewhen handling responses. However the typings are not generic, they are hard coded to useClientResponseso custom aspects of theresponse_classresult in type errors.To Reproduce
response_classClientSession, e.g.client.post()response_classin 1 will be used, but it will still be typed as the defaultClientResponseExpected behavior
Use the
response_classtype in typings.Versions
Code of Conduct