Skip to content

Commit 503522c

Browse files
committed
Added tuple to possible data types of route(methods=...)
1 parent be65668 commit 503522c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_httpserver/route.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
try:
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

119119
def 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

Comments
 (0)