@@ -104,7 +104,7 @@ def __init__(
104
104
host_matching : bool = False ,
105
105
) -> None :
106
106
self ._matcher = StateMachineMatcher (merge_slashes )
107
- self ._rules_by_endpoint : dict [str , list [Rule ]] = {}
107
+ self ._rules_by_endpoint : dict [t . Any , list [Rule ]] = {}
108
108
self ._remap = True
109
109
self ._remap_lock = self .lock_class ()
110
110
@@ -131,7 +131,7 @@ def merge_slashes(self) -> bool:
131
131
def merge_slashes (self , value : bool ) -> None :
132
132
self ._matcher .merge_slashes = value
133
133
134
- def is_endpoint_expecting (self , endpoint : str , * arguments : str ) -> bool :
134
+ def is_endpoint_expecting (self , endpoint : t . Any , * arguments : str ) -> bool :
135
135
"""Iterate over all rules and check if the endpoint expects
136
136
the arguments provided. This is for example useful if you have
137
137
some URLs that expect a language code and others that do not and
@@ -155,7 +155,7 @@ def is_endpoint_expecting(self, endpoint: str, *arguments: str) -> bool:
155
155
def _rules (self ) -> list [Rule ]:
156
156
return [rule for rules in self ._rules_by_endpoint .values () for rule in rules ]
157
157
158
- def iter_rules (self , endpoint : str | None = None ) -> t .Iterator [Rule ]:
158
+ def iter_rules (self , endpoint : t . Any | None = None ) -> t .Iterator [Rule ]:
159
159
"""Iterate over all rules or the rules of an endpoint.
160
160
161
161
:param endpoint: if provided only the rules for that endpoint
@@ -470,14 +470,14 @@ def application(environ, start_response):
470
470
raise
471
471
472
472
@t .overload
473
- def match ( # type: ignore
473
+ def match (
474
474
self ,
475
475
path_info : str | None = None ,
476
476
method : str | None = None ,
477
477
return_rule : t .Literal [False ] = False ,
478
478
query_args : t .Mapping [str , t .Any ] | str | None = None ,
479
479
websocket : bool | None = None ,
480
- ) -> tuple [str , t .Mapping [str , t .Any ]]: ...
480
+ ) -> tuple [t . Any , t .Mapping [str , t .Any ]]: ...
481
481
482
482
@t .overload
483
483
def match (
@@ -496,7 +496,7 @@ def match(
496
496
return_rule : bool = False ,
497
497
query_args : t .Mapping [str , t .Any ] | str | None = None ,
498
498
websocket : bool | None = None ,
499
- ) -> tuple [str | Rule , t .Mapping [str , t .Any ]]:
499
+ ) -> tuple [t . Any | Rule , t .Mapping [str , t .Any ]]:
500
500
"""The usage is simple: you just pass the match method the current
501
501
path info as well as the method (which defaults to `GET`). The
502
502
following things can then happen:
@@ -770,7 +770,7 @@ def make_redirect_url(
770
770
def make_alias_redirect_url (
771
771
self ,
772
772
path : str ,
773
- endpoint : str ,
773
+ endpoint : t . Any ,
774
774
values : t .Mapping [str , t .Any ],
775
775
method : str ,
776
776
query_args : t .Mapping [str , t .Any ] | str ,
@@ -786,7 +786,7 @@ def make_alias_redirect_url(
786
786
787
787
def _partial_build (
788
788
self ,
789
- endpoint : str ,
789
+ endpoint : t . Any ,
790
790
values : t .Mapping [str , t .Any ],
791
791
method : str | None ,
792
792
append_unknown : bool ,
@@ -827,7 +827,7 @@ def _partial_build(
827
827
828
828
def build (
829
829
self ,
830
- endpoint : str ,
830
+ endpoint : t . Any ,
831
831
values : t .Mapping [str , t .Any ] | None = None ,
832
832
method : str | None = None ,
833
833
force_external : bool = False ,
0 commit comments