Skip to content

Commit

Permalink
fix type signature for _RuleList
Browse files Browse the repository at this point in the history
`List` is invariant, `Sequence` is covariant
  • Loading branch information
mhils authored Jan 17, 2025
1 parent 73a87a5 commit 58f34b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tornado/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def request_callable(request):
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):
Expand Down Expand Up @@ -286,7 +286,7 @@ def finish(self) -> None:

# _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.
Expand Down

0 comments on commit 58f34b8

Please sign in to comment.