Skip to content

Commit e2a4761

Browse files
committed
Made variable name and docstring more verbose
1 parent cf69035 commit e2a4761

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_httpserver/route.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@ def __init__(self, path: str = "", method: HTTPMethod = HTTPMethod.GET) -> None:
2626

2727
self.path = path if not contains_regex else re.sub(r"<\w*>", r"([^/]*)", path)
2828
self.method = method
29-
self.regex = contains_regex
29+
self._contains_regex = contains_regex
3030

3131
def matches(self, other: "_HTTPRoute") -> bool:
3232
"""
3333
Checks if the route matches the other route.
3434
35-
If the route contains parameters, it will check if the other route contains values for them.
35+
If the route contains parameters, it will check if the ``other`` route contains values for
36+
them.
3637
"""
3738

38-
if self.regex or other.regex:
39+
if self._contains_regex:
3940
return re.match(self.path, other.path) and self.method == other.method
4041

4142
return self.method == other.method and self.path == other.path

0 commit comments

Comments
 (0)