diff --git a/CHANGES/4125.feature b/CHANGES/4125.feature new file mode 100644 index 00000000000..43dd2638b4f --- /dev/null +++ b/CHANGES/4125.feature @@ -0,0 +1 @@ +Use `Iterable` hint instead of `Sequence` for `Application` `middleware` parameter. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index d126b74eb47..f28a8f9eaee 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -223,6 +223,7 @@ Simon Kennedy Sin-Woo Bang Stanislas Plum Stanislav Prokop +Stefan Tjarks Stepan Pletnev Stephen Granade Steven Seguin diff --git a/aiohttp/web_app.py b/aiohttp/web_app.py index a70ff506fd0..f668feeae4b 100644 --- a/aiohttp/web_app.py +++ b/aiohttp/web_app.py @@ -75,7 +75,7 @@ class Application(MutableMapping[str, Any]): def __init__(self, *, logger: logging.Logger=web_logger, - middlewares: Sequence[_Middleware]=(), + middlewares: Iterable[_Middleware]=(), handler_args: Mapping[str, Any]=None, client_max_size: int=1024**2, debug: Any=... # mypy doesn't support ellipsis