mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
A couple new definitions, some more unicode for 2.7 (#185)
* Action.__init__(); ArgumentParser.__init__() & print_help()
* pprint() & pformat()
* added unicode support to url{parse,split,join,defrag}
* add unicode support to requests.api
This commit is contained in:
committed by
Guido van Rossum
parent
eab591bb08
commit
0be5a11496
@@ -1,6 +1,6 @@
|
||||
# Stubs for urlparse (Python 2)
|
||||
|
||||
from typing import Dict, List, NamedTuple, Tuple, Sequence, overload
|
||||
from typing import Dict, List, NamedTuple, Tuple, Sequence, Union, overload
|
||||
|
||||
uses_relative = [] # type: List[str]
|
||||
uses_netloc = [] # type: List[str]
|
||||
@@ -34,8 +34,10 @@ class ParseResult(NamedTuple('ParseResult', [
|
||||
]), ResultMixin):
|
||||
def geturl(self) -> str: ...
|
||||
|
||||
def urlparse(url: str, scheme: str = ..., allow_fragments: bool = ...) -> ParseResult: ...
|
||||
def urlsplit(url: str, scheme: str = ..., allow_fragments: bool = ...) -> SplitResult: ...
|
||||
def urlparse(url: Union[str, unicode], scheme: str = ...,
|
||||
allow_fragments: bool = ...) -> ParseResult: ...
|
||||
def urlsplit(url: Union[str, unicode], scheme: str = ...,
|
||||
allow_fragments: bool = ...) -> SplitResult: ...
|
||||
@overload
|
||||
def urlunparse(data: Tuple[str, str, str, str, str, str]) -> str: ...
|
||||
@overload
|
||||
@@ -44,8 +46,9 @@ def urlunparse(data: Sequence[str]) -> str: ...
|
||||
def urlunsplit(data: Tuple[str, str, str, str, str]) -> str: ...
|
||||
@overload
|
||||
def urlunsplit(data: Sequence[str]) -> str: ...
|
||||
def urljoin(base: str, url: str, allow_fragments: bool = ...) -> str: ...
|
||||
def urldefrag(url: str) -> str: ...
|
||||
def urljoin(base: Union[str, unicode], url: Union[str, unicode],
|
||||
allow_fragments: bool = ...) -> str: ...
|
||||
def urldefrag(url: Union[str, unicode]) -> str: ...
|
||||
def unquote(s: str) -> str: ...
|
||||
def parse_qs(qs: str, keep_blank_values: bool = ...,
|
||||
strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
|
||||
|
||||
Reference in New Issue
Block a user