88"""
99
1010try :
11- from typing import Callable , List , Set , Union , Tuple , Dict , TYPE_CHECKING
11+ from typing import Callable , List , Iterable , Union , Tuple , Dict , TYPE_CHECKING
1212
1313 if TYPE_CHECKING :
1414 from .response import Response
@@ -26,7 +26,7 @@ class Route:
2626 def __init__ (
2727 self ,
2828 path : str = "" ,
29- methods : Union [str , Set [str ]] = GET ,
29+ methods : Union [str , Iterable [str ]] = GET ,
3030 handler : Callable = None ,
3131 * ,
3232 append_slash : bool = False ,
@@ -40,7 +40,7 @@ def __init__(
4040 "..." , r"[^/]+"
4141 ) + ("/?" if append_slash else "" )
4242 self .methods = (
43- set (methods ) if isinstance (methods , (set , list )) else set ([methods ])
43+ set (methods ) if isinstance (methods , (set , list , tuple )) else set ([methods ])
4444 )
4545
4646 self .handler = handler
@@ -118,7 +118,7 @@ def __repr__(self) -> str:
118118
119119def as_route (
120120 path : str ,
121- methods : Union [str , Set [str ]] = GET ,
121+ methods : Union [str , Iterable [str ]] = GET ,
122122 * ,
123123 append_slash : bool = False ,
124124) -> "Callable[[Callable[..., Response]], Route]" :
0 commit comments