Skip to content

Commit 410e5ab

Browse files
CoolCat467davidism
authored andcommitted
Accept AsyncIterable for responses
1 parent bfffe87 commit 410e5ab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGES.rst

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Unreleased
66
- Fix type hint for `cli_runner.invoke`. :issue:`5645`
77
- ``flask --help`` loads the app and plugins first to make sure all commands
88
are shown. :issue:5673`
9+
- Mark sans-io base class as being able to handle views that return
10+
``AsyncIterable``. This is not accurate for Flask, but makes typing easier
11+
for Quart. :pr:`5659`
912

1013

1114
Version 3.1.0

src/flask/typing.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import collections.abc as cabc
34
import typing as t
45

56
if t.TYPE_CHECKING: # pragma: no cover
@@ -17,6 +18,8 @@
1718
t.Mapping[str, t.Any],
1819
t.Iterator[str],
1920
t.Iterator[bytes],
21+
cabc.AsyncIterable[str], # for Quart, until App is generic.
22+
cabc.AsyncIterable[bytes],
2023
]
2124

2225
# the possible types for an individual HTTP header

0 commit comments

Comments
 (0)