Skip to content
Myr

improve typing for `stream_with_context`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 6b1c4e9 · Browse files · 2 files+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−2 removed

  • other:+5 added−2 removed

2 files+5 added−2 removed

modified:src/flask/helpers.py+4 added-2 removed
62 unmodified lines
63 return val.lower() in ("0", "false", "no")646566def stream_with_context(67 generator_or_function: t.Union[t.Generator, t.Callable]68) -> t.Generator:67 generator_or_function: t.Union[68 t.Iterator[t.AnyStr], t.Callable[..., t.Iterator[t.AnyStr]]69 ]70) -> t.Iterator[t.AnyStr]:71 """Request contexts disappear when the response is started on the server.72 This is done for efficiency reasons and to make it less likely to encounter73 memory leaks with badly written WSGI middlewares. The downside is that if74 you are using streamed responses, the generator cannot access request bound
762 unmodified lines
modified:CHANGES.rst+1 added
33 unmodified lines
34 (pre-dotted) name the blueprint is registered with. This allows the35 same blueprint to be registered multiple times with unique names for36 ``url_for``. Registering the same blueprint with the same name37 multiple times is deprecated. :issue:`1091`38- Improve typing for ``stream_with_context``. :issue:`4052`394041Version 2.0.042-------------
1116 unmodified lines