File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,21 @@ def get_load_dotenv(default: bool = True) -> bool:
4747 return val .lower () in ("0" , "false" , "no" )
4848
4949
50+ @t .overload
51+ def stream_with_context (
52+ generator_or_function : t .Iterator [t .AnyStr ],
53+ ) -> t .Iterator [t .AnyStr ]: ...
54+
55+
56+ @t .overload
57+ def stream_with_context (
58+ generator_or_function : t .Callable [..., t .Iterator [t .AnyStr ]],
59+ ) -> t .Callable [[t .Iterator [t .AnyStr ]], t .Iterator [t .AnyStr ]]: ...
60+
61+
5062def stream_with_context (
5163 generator_or_function : t .Iterator [t .AnyStr ] | t .Callable [..., t .Iterator [t .AnyStr ]],
52- ) -> t .Iterator [t .AnyStr ]:
64+ ) -> t .Iterator [t .AnyStr ] | t . Callable [[ t . Iterator [ t . AnyStr ]], t . Iterator [ t . AnyStr ]] :
5365 """Request contexts disappear when the response is started on the server.
5466 This is done for efficiency reasons and to make it less likely to encounter
5567 memory leaks with badly written WSGI middlewares. The downside is that if
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ def _default(o: t.Any) -> t.Any:
113113 return str (o )
114114
115115 if dataclasses and dataclasses .is_dataclass (o ):
116- return dataclasses .asdict (o )
116+ return dataclasses .asdict (o ) # type: ignore[call-overload]
117117
118118 if hasattr (o , "__html__" ):
119119 return str (o .__html__ ())
You can’t perform that action at this time.
0 commit comments