Skip to content

Commit e1f6f47

Browse files
committed
Fix lint
1 parent b35e82c commit e1f6f47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: docs/examples/python/custom_router_easy_resolver.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
from typing import ClassVar
2+
13
from reactpy_router.resolvers import ConversionInfo, ReactPyResolver
24

35

46
# Create a custom resolver that uses the following pattern: "{name:type}"
57
class CustomResolver(ReactPyResolver):
68
# Match parameters that use the "<name:type>" format
7-
param_pattern = r"<(?P<name>\w+)(?P<type>:\w+)?>"
9+
param_pattern: str = r"<(?P<name>\w+)(?P<type>:\w+)?>"
810

911
# Enable matching for the following types: int, str, any
10-
converters = {
12+
converters: ClassVar[dict[str, ConversionInfo]] = {
1113
"int": ConversionInfo(regex=r"\d+", func=int),
1214
"str": ConversionInfo(regex=r"[^/]+", func=str),
1315
"any": ConversionInfo(regex=r".*", func=str),

0 commit comments

Comments
 (0)