From: Maximilian Hils Date: Fri, 17 Jan 2025 16:37:50 +0000 (+0100) Subject: fix type signature for `_RuleList` X-Git-Tag: v6.5.0b1~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3455%2Fhead;p=thirdparty%2Ftornado.git fix type signature for `_RuleList` `List` is invariant, `Sequence` is covariant --- diff --git a/tornado/routing.py b/tornado/routing.py index ee81f977..ef99c20b 100644 --- a/tornado/routing.py +++ b/tornado/routing.py @@ -184,7 +184,7 @@ from tornado.escape import url_escape, url_unescape, utf8 from tornado.log import app_log from tornado.util import basestring_type, import_object, re_unescape, unicode_type -from typing import Any, Union, Optional, Awaitable, List, Dict, Pattern, Tuple, overload +from typing import Any, Union, Optional, Awaitable, List, Dict, Pattern, Tuple, overload, Sequence class Router(httputil.HTTPServerConnectionDelegate): @@ -286,7 +286,7 @@ class _DefaultMessageDelegate(httputil.HTTPMessageDelegate): # _RuleList can either contain pre-constructed Rules or a sequence of # arguments to be passed to the Rule constructor. -_RuleList = List[ +_RuleList = Sequence[ Union[ "Rule", List[Any], # Can't do detailed typechecking of lists.