Skip to content

Commit 7192c21

Browse files
committed
Add a very short blurb to document URLSearchParams.
1 parent ceaffa4 commit 7192c21

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ url.search = "?q=canada&safe=off"
6060
print(url) # https://google.com/search?q=canada&safe=off
6161
```
6262

63+
`can_ada` also supports the `URLSearchParams` API:
64+
65+
```python
66+
from can_ada import URLSearchParams
67+
68+
params = URLSearchParams("q=canada&safe=off")
69+
params.append("page", "2")
70+
params.append("page", "3")
71+
params["q"] = "usa"
72+
print(params) # q=usa&safe=off&page=2&page=3
73+
print(params.has("q")) # True
74+
print(params.get("page")) # 2
75+
print(params.get_all("page")) # [2, 3]
76+
print(params.keys()) # ["q", "safe", "page"]
77+
print(params.values()) # ["usa", "off", "2", "3"]
78+
```
79+
6380
## Performance
6481

6582
We find that `can_ada` is typically ~4x faster than urllib:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
]
3333
},
3434
zip_safe=False,
35-
python_requires=">=3.7",
35+
python_requires=">=3.9",
3636
)

0 commit comments

Comments
 (0)