aio-libs / aio-libs/aiohttp

Typings aren't generic enough when using `response_class`

オープン
#7,109 コメント 18 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
16.5k
フォーク
2.4k
平均マージ
17時間 22分
マージ済み PR(30日)
212

説明

### 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

1. Add a custom `response_class`
2. Use a request method on a `ClientSession`, e.g. `client.post()`
3. 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

```console
python=3.10.8
aiohttp=3.8.3
```

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。