Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing to URL #1084

Merged
merged 33 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9fdff60
Add typing to URL
bdraco Sep 2, 2024
8576fb0
changelog
bdraco Sep 2, 2024
086a550
py3.8
bdraco Sep 2, 2024
0fb8bad
Merge branch 'master' into typing
bdraco Sep 2, 2024
10b65f3
Update CHANGES/1084.contrib.rst
bdraco Sep 2, 2024
39c5596
feature as well
bdraco Sep 2, 2024
394d1ba
Merge remote-tracking branch 'origin/typing' into typing
bdraco Sep 2, 2024
857a9cd
copy exclude from aiohttp
bdraco Sep 2, 2024
20ae93d
Merge branch 'master' into typing
bdraco Sep 2, 2024
5e9996d
comments, preen
bdraco Sep 2, 2024
0aa1802
Merge remote-tracking branch 'origin/master' into typing
bdraco Sep 2, 2024
40c71a0
Merge remote-tracking branch 'origin/master' into typing
bdraco Sep 2, 2024
f5d5097
Merge remote-tracking branch 'origin/typing' into typing
bdraco Sep 2, 2024
3f1eb2b
Merge branch 'master' into typing
webknjaz Sep 3, 2024
46633ba
Merge branch 'master' into typing
bdraco Sep 3, 2024
041ea65
Update .coveragerc
bdraco Sep 3, 2024
cc17104
drop pyi
bdraco Sep 3, 2024
d070738
drop pyi since everything is typed now
bdraco Sep 3, 2024
92f98f7
add more types
bdraco Sep 3, 2024
5bb533c
add more types
bdraco Sep 3, 2024
2cb091e
de-dupe
bdraco Sep 3, 2024
78bab1b
de-dupe
bdraco Sep 3, 2024
61d9545
adjust for py3.8
bdraco Sep 3, 2024
1645452
lint
bdraco Sep 3, 2024
db3750a
Update .coveragerc
bdraco Sep 3, 2024
0af0733
keep helpers_c
bdraco Sep 3, 2024
521ba15
Update yarl/_url.py
bdraco Sep 3, 2024
5d1b7a2
Merge branch 'master' into typing
bdraco Sep 3, 2024
b0e4e1c
type dunder compares to object
bdraco Sep 3, 2024
c6d37d9
Update yarl/_url.py
bdraco Sep 3, 2024
2aef0e7
Iterator
bdraco Sep 3, 2024
915ab95
remove hint
bdraco Sep 3, 2024
24768b8
temp lower
bdraco Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1084.contrib.rst
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Covered the :class:`~yarl.URL` object with types -- by :user:`bdraco`.
4 changes: 2 additions & 2 deletions yarl/_quoting_c.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class _Quoter:
qs: bool = ...,
requote: bool = ...
) -> None: ...
def __call__(self, val: Optional[str] = ...) -> Optional[str]: ...
def __call__(self, val: str = ...) -> str: ...

class _Unquoter:
def __init__(
self, *, ignore: str = ..., unsafe: str = ..., qs: bool = ...
) -> None: ...
def __call__(self, val: Optional[str] = ...) -> Optional[str]: ...
def __call__(self, val: str = ...) -> str: ...
6 changes: 3 additions & 3 deletions yarl/_quoting_py.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import codecs
import re
from string import ascii_letters, ascii_lowercase, digits
from typing import Optional, cast
from typing import cast

BASCII_LOWERCASE = ascii_lowercase.encode("ascii")
BPCT_ALLOWED = {f"%{i:02X}".encode("ascii") for i in range(256)}
Expand Down Expand Up @@ -33,7 +33,7 @@ def __init__(
self._qs = qs
self._requote = requote

def __call__(self, val: Optional[str]) -> Optional[str]:
def __call__(self, val: str) -> str:
if val is None:
return None
if not isinstance(val, str):
Expand Down Expand Up @@ -123,7 +123,7 @@ def __init__(self, *, ignore: str = "", unsafe: str = "", qs: bool = False) -> N
self._quoter = _Quoter()
self._qs_quoter = _Quoter(qs=True)

def __call__(self, val: Optional[str]) -> Optional[str]:
def __call__(self, val: str) -> str:
if val is None:
return None
if not isinstance(val, str):
Expand Down
Loading
Loading