Skip to content

Commit e34d27d

Browse files
committed
Fix: Wrong returns in docstring
1 parent d372f8e commit e34d27d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

adafruit_httpserver/route.py

Lines changed: 9 additions & 9 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, TYPE_CHECKING
11+
from typing import Callable, List, Set, Union, Tuple, Dict, TYPE_CHECKING
1212

1313
if TYPE_CHECKING:
1414
from .response import Response
@@ -56,7 +56,7 @@ def _validate_path(path: str, append_slash: bool) -> None:
5656
if path.endswith("/") and append_slash:
5757
raise ValueError("Cannot use append_slash=True when path ends with /")
5858

59-
def match(self, other: "Route") -> Tuple[bool, List[str]]:
59+
def match(self, other: "Route") -> Tuple[bool, Dict[str, str]]:
6060
"""
6161
Checks if the route matches the other route.
6262
@@ -72,31 +72,31 @@ def match(self, other: "Route") -> Tuple[bool, List[str]]:
7272
7373
other1a = Route("/example", GET)
7474
other1b = Route("/example/", GET)
75-
route.matches(other1a) # True, []
76-
route.matches(other1b) # True, []
75+
route.matches(other1a) # True, {}
76+
route.matches(other1b) # True, {}
7777
7878
other2 = Route("/other-example", GET)
79-
route.matches(other2) # False, []
79+
route.matches(other2) # False, {}
8080
8181
...
8282
8383
route = Route("/example/<parameter>", GET)
8484
8585
other1 = Route("/example/123", GET)
86-
route.matches(other1) # True, ["123"]
86+
route.matches(other1) # True, {"parameter": "123"}
8787
8888
other2 = Route("/other-example", GET)
89-
route.matches(other2) # False, []
89+
route.matches(other2) # False, {}
9090
9191
...
9292
9393
route1 = Route("/example/.../something", GET)
9494
other1 = Route("/example/123/something", GET)
95-
route1.matches(other1) # True, []
95+
route1.matches(other1) # True, {}
9696
9797
route2 = Route("/example/..../something", GET)
9898
other2 = Route("/example/123/456/something", GET)
99-
route2.matches(other2) # True, []
99+
route2.matches(other2) # True, {}
100100
"""
101101

102102
if not other.methods.issubset(self.methods):

0 commit comments

Comments
 (0)