Skip to content

Commit 58f34b8

Browse files
authored
fix type signature for _RuleList
`List` is invariant, `Sequence` is covariant
1 parent 73a87a5 commit 58f34b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tornado/routing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def request_callable(request):
184184
from tornado.log import app_log
185185
from tornado.util import basestring_type, import_object, re_unescape, unicode_type
186186

187-
from typing import Any, Union, Optional, Awaitable, List, Dict, Pattern, Tuple, overload
187+
from typing import Any, Union, Optional, Awaitable, List, Dict, Pattern, Tuple, overload, Sequence
188188

189189

190190
class Router(httputil.HTTPServerConnectionDelegate):
@@ -286,7 +286,7 @@ def finish(self) -> None:
286286

287287
# _RuleList can either contain pre-constructed Rules or a sequence of
288288
# arguments to be passed to the Rule constructor.
289-
_RuleList = List[
289+
_RuleList = Sequence[
290290
Union[
291291
"Rule",
292292
List[Any], # Can't do detailed typechecking of lists.

0 commit comments

Comments
 (0)