Merge branch '3.0.x'
This commit is contained in:
commit
4e6384da32
16 changed files with 112 additions and 104 deletions
|
|
@ -47,9 +47,21 @@ def get_load_dotenv(default: bool = True) -> bool:
|
|||
return val.lower() in ("0", "false", "no")
|
||||
|
||||
|
||||
@t.overload
|
||||
def stream_with_context(
|
||||
generator_or_function: t.Iterator[t.AnyStr],
|
||||
) -> t.Iterator[t.AnyStr]: ...
|
||||
|
||||
|
||||
@t.overload
|
||||
def stream_with_context(
|
||||
generator_or_function: t.Callable[..., t.Iterator[t.AnyStr]],
|
||||
) -> t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]: ...
|
||||
|
||||
|
||||
def stream_with_context(
|
||||
generator_or_function: t.Iterator[t.AnyStr] | t.Callable[..., t.Iterator[t.AnyStr]],
|
||||
) -> t.Iterator[t.AnyStr]:
|
||||
) -> t.Iterator[t.AnyStr] | t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]:
|
||||
"""Request contexts disappear when the response is started on the server.
|
||||
This is done for efficiency reasons and to make it less likely to encounter
|
||||
memory leaks with badly written WSGI middlewares. The downside is that if
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ def _default(o: t.Any) -> t.Any:
|
|||
return str(o)
|
||||
|
||||
if dataclasses and dataclasses.is_dataclass(o):
|
||||
return dataclasses.asdict(o)
|
||||
return dataclasses.asdict(o) # type: ignore[call-overload]
|
||||
|
||||
if hasattr(o, "__html__"):
|
||||
return str(o.__html__())
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ class App(Scaffold):
|
|||
instance_path: str | None = None,
|
||||
instance_relative_config: bool = False,
|
||||
root_path: str | None = None,
|
||||
):
|
||||
) -> None:
|
||||
super().__init__(
|
||||
import_name=import_name,
|
||||
static_folder=static_folder,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue