Make the urllib.quote/unquote functions generic (#1891)

When given unicode they will return unicode.
Also make 'safe' Text.
Fixes #1893.
This commit is contained in:
Guido van Rossum
2018-02-16 13:14:05 -08:00
committed by GitHub
parent 3e85d6bb61
commit 100a071729

View File

@@ -1,4 +1,4 @@
from typing import Any, Mapping, Union, Tuple, Sequence, IO
from typing import Any, AnyStr, IO, Mapping, Sequence, Text, Tuple, Union
def url2pathname(pathname: str) -> str: ...
def pathname2url(pathname: str) -> str: ...
@@ -119,10 +119,10 @@ def splitquery(url): ...
def splittag(url): ...
def splitattr(url): ...
def splitvalue(attr): ...
def unquote(s: str) -> str: ...
def unquote_plus(s: str) -> str: ...
def quote(s: str, safe=...) -> str: ...
def quote_plus(s: str, safe=...) -> str: ...
def unquote(s: AnyStr) -> AnyStr: ...
def unquote_plus(s: AnyStr) -> AnyStr: ...
def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ...
def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ...
def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ...
def getproxies() -> Mapping[str, str]: ...