From 2f11234724a37e0385bfc7f9cfd6aff277f78427 Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Tue, 1 Oct 2024 23:56:46 +0200 Subject: [PATCH] refactor(mediatypes): use a stricter type annotation --- falcon/util/mediatypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/falcon/util/mediatypes.py b/falcon/util/mediatypes.py index 1e14c9d59..b72c52c5c 100644 --- a/falcon/util/mediatypes.py +++ b/falcon/util/mediatypes.py @@ -290,7 +290,7 @@ def quality(media_type: str, header: str) -> float: return most_specific[-1] -def best_match(media_types: Iterable[str], header: str) -> Optional[str]: +def best_match(media_types: Iterable[str], header: str) -> str: """Choose media type with the highest :func:`quality` from a list of candidates.