Skip to content

Commit 5ebf892

Browse files
authored
Allow urlparse and urlsplit of bytes URLs (#9746)
1 parent 75cd302 commit 5ebf892

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

stdlib/urllib/parse.pyi

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,22 @@ def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> A
192192
@overload
193193
def urlparse(url: str, scheme: str = "", allow_fragments: bool = True) -> ParseResult: ...
194194
@overload
195-
def urlparse(url: bytes | bytearray, scheme: bytes | bytearray | None, allow_fragments: bool = True) -> ParseResultBytes: ...
196-
@overload
197195
def urlparse(
198-
url: None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True
196+
url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True
199197
) -> ParseResultBytes: ...
200198
@overload
201199
def urlsplit(url: str, scheme: str = "", allow_fragments: bool = True) -> SplitResult: ...
202200

203201
if sys.version_info >= (3, 11):
204202
@overload
205-
def urlsplit(url: bytes, scheme: bytes | None, allow_fragments: bool = True) -> SplitResultBytes: ...
206-
@overload
207-
def urlsplit(url: None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True) -> SplitResultBytes: ...
203+
def urlsplit(
204+
url: bytes | None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True
205+
) -> SplitResultBytes: ...
208206

209207
else:
210-
@overload
211-
def urlsplit(url: bytes | bytearray, scheme: bytes | bytearray | None, allow_fragments: bool = True) -> SplitResultBytes: ...
212208
@overload
213209
def urlsplit(
214-
url: None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True
210+
url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True
215211
) -> SplitResultBytes: ...
216212

217213
@overload

0 commit comments

Comments
 (0)