docs: add module-level docstring to typing module

Documents the type aliases used throughout Flask's public API,
including response values, header values, and callback signatures.
This commit is contained in:
SUPREME 2026-05-31 13:25:21 +05:30
parent 954f5684e4
commit 8743c743af

View file

@ -1,3 +1,11 @@
"""
Type aliases for Flask's public API.
Defines the type aliases used throughout Flask for route return values,
header values, and callback signatures. These provide precise type
information for IDE support and static type checking.
"""
from __future__ import annotations
import collections.abc as cabc
@ -20,7 +28,7 @@ ResponseValue = t.Union[
t.Iterator[bytes],
cabc.AsyncIterable[str], # for Quart, until App is generic.
cabc.AsyncIterable[bytes],
]
:]
# the possible types for an individual HTTP header
HeaderValue = str | list[str] | tuple[str, ...]
@ -30,7 +38,7 @@ HeadersValue = t.Union[
"Headers",
t.Mapping[str, HeaderValue],
t.Sequence[tuple[str, HeaderValue]],
]
:]
# The possible types returned by a route function.
ResponseReturnValue = t.Union[