aio-libs / aio-libs/aiohttp

Changing readers to async iterators

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

説明

### Is your feature request related to a problem?

Not problem, but looks legacy

```
while True:
chunk = await field.read_chunk()
if not chunk:
break
```

or

```
reader = await request.multipart()
while True:
field = await reader.next()
if field is None: break
```

### Describe the solution you'd like

```
async for chunk in field.chunks():
f.write(chunk)
```

or

```
async for field in (await request.multipart()):
....
```

### Describe alternatives you've considered

Or fix docs on objects already has __anext__ interface.

### Related component

Server

### Additional context

_No response_

### Code of Conduct

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

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

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

評価

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

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

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