From eb90eddd8fd1077b19b969b8007523d5eb86161f Mon Sep 17 00:00:00 2001 From: rymdhund Date: Thu, 24 Nov 2016 12:45:20 +0100 Subject: [PATCH] Fix urllib.parse.urlencode signature (#702) Fixes #700 --- stdlib/3/urllib/parse.pyi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stdlib/3/urllib/parse.pyi b/stdlib/3/urllib/parse.pyi index 3e5433f25..7dd65ce90 100644 --- a/stdlib/3/urllib/parse.pyi +++ b/stdlib/3/urllib/parse.pyi @@ -1,5 +1,5 @@ # Stubs for urllib.parse -from typing import List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping +from typing import List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union __all__ = ( 'urlparse', @@ -111,10 +111,11 @@ def urldefrag(url: str) -> DefragResult: ... @overload def urldefrag(url: bytes) -> DefragResultBytes: ... -@overload -def urlencode(query: Mapping[AnyStr, AnyStr], doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... -@overload -def urlencode(query: Sequence[Tuple[AnyStr, AnyStr]], doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... +def urlencode(query: Union[Mapping[AnyStr, AnyStr], + Mapping[AnyStr, Sequence[AnyStr]], + Sequence[Tuple[AnyStr, AnyStr]], + Sequence[Tuple[AnyStr, Sequence[AnyStr]]]], + doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... def urljoin(base: AnyStr, url: AnyStr, allow_fragments: bool = ...) -> AnyStr: ...