aio-libs / aio-libs/aiohttp

Changing readers to async iterators

Abierto
#5,911 0 comentarios 2 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
16.5k
Forks
2.4k
Merge medio
17 h 22 min
PR fusionados (30 d)
212

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.