Skip to content

Commit d617183

Browse files
committed
fix: fix type for parse_search_params()
1 parent a3bbeaa commit d617183

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ada_url/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ada_url.ada_adapter import (
2+
URL,
23
HostType,
34
SchemeType,
4-
URL,
55
URLSearchParams,
66
check_url,
77
idna,

ada_url/ada_adapter.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
from enum import IntEnum
2-
from typing import Final, Iterable, Iterator, List, Optional, Tuple, TypedDict, Union
2+
from typing import (
3+
Dict,
4+
Final,
5+
Iterable,
6+
Iterator,
7+
List,
8+
Optional,
9+
Tuple,
10+
TypedDict,
11+
Union,
12+
)
313

414
from ada_url._ada_wrapper import ffi, lib
515

@@ -648,7 +658,7 @@ def replace_url(s: str, **kwargs: str) -> str:
648658
return _get_str(lib.ada_get_href(urlobj))
649659

650660

651-
def parse_search_params(s: str) -> dict:
661+
def parse_search_params(s: str) -> Dict[str, List[str]]:
652662
"""
653663
Returns a dictionary representing the parsed URL Parameters specified by *s*.
654664
The returned dictionary maps each key to a list of values associated with it.
@@ -660,7 +670,7 @@ def parse_search_params(s: str) -> dict:
660670
{'key1': ['value1', 'value2'], 'key2': ['value3']}
661671
662672
"""
663-
ret = {}
673+
ret: Dict[str, List[str]] = {}
664674
for key, value in URLSearchParams(s).items():
665675
if key not in ret:
666676
ret[key] = [value]

0 commit comments

Comments
 (0)