-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResponseValue Typing issue #5322
ResponseValue Typing issue #5322
Comments
Flask doesn't accept that though. It would be Quart's response type that should allow that type. If it doesn't, that should be reported to Quart. |
This one is a Flask issue now that Quart is based on Flask. I think the solution is to make the Flask sansio classes Generic over the response type. (Or support async iterators in Flask which could be nice). @CoolCat467 Something to |
Ok, wasn't clear that Quart was passing through Flask's type here. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yeah looking at this again during the pycon 2024 sprints, the naive fix for this reported issue seems to be just adding If anything, quart's |
Looks like this was fixed in Quart instead? If that's not the case, I can reopen this. |
This is not a runtime bug but a typing issue. In
flask.typing
,ResponseValue
does not acceptAsyncIterator[str]
.I am using
quart-trio
, which itself usesquart
, which usesflask
.quart.templating.stream_template
returnsAsyncIterator[str]
, and when running mypy on my project I get the following error:Example usage:
templates/error_page.html.jinja
Environment:
The text was updated successfully, but these errors were encountered: