From 70dc6f73fb9b130e9e548b62b3ff9ff2a8a9e870 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 7 Jun 2024 14:51:34 -0400 Subject: [PATCH] web: Type SUPPORTED_METHODS so it can be overridden Its default type is `Tuple[str, str, str, str, str, str, str]`, which can only be overridden by a tuple of the exact same length. This change originated in #3354 (thanks alexmv and andersk). Closes #3354 --- tornado/web.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index 21d0cad6..207b5ddd 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -192,7 +192,15 @@ class RequestHandler(object): """ - SUPPORTED_METHODS = ("GET", "HEAD", "POST", "DELETE", "PATCH", "PUT", "OPTIONS") + SUPPORTED_METHODS: Tuple[str, ...] = ( + "GET", + "HEAD", + "POST", + "DELETE", + "PATCH", + "PUT", + "OPTIONS", + ) _template_loaders = {} # type: Dict[str, template.BaseLoader] _template_loader_lock = threading.Lock() -- 2.47.2