mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
urllib: update for py38 (#3574)
* urllib.robotparser: add site_maps * urllib.parse: add max_num_fields parameter
This commit is contained in:
committed by
Sebastian Rittau
parent
7b5e9dca48
commit
45688b936e
@@ -1,5 +1,6 @@
|
||||
# Stubs for urllib.parse
|
||||
from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional
|
||||
import sys
|
||||
|
||||
_Str = Union[bytes, str]
|
||||
|
||||
@@ -81,11 +82,31 @@ class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ...
|
||||
|
||||
class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def parse_qs(
|
||||
qs: Optional[AnyStr],
|
||||
keep_blank_values: bool = ...,
|
||||
strict_parsing: bool = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
max_num_fields: Optional[int] = ...,
|
||||
) -> Dict[AnyStr, List[AnyStr]]: ...
|
||||
def parse_qsl(
|
||||
qs: Optional[AnyStr],
|
||||
keep_blank_values: bool = ...,
|
||||
strict_parsing: bool = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
max_num_fields: Optional[int] = ...,
|
||||
) -> List[Tuple[AnyStr, AnyStr]]: ...
|
||||
|
||||
def parse_qs(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ...
|
||||
|
||||
def parse_qsl(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ...
|
||||
|
||||
else:
|
||||
def parse_qs(
|
||||
qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...,
|
||||
) -> Dict[AnyStr, List[AnyStr]]: ...
|
||||
def parse_qsl(
|
||||
qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...,
|
||||
) -> List[Tuple[AnyStr, AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Stubs for urllib.robotparser (Python 3.4)
|
||||
|
||||
from typing import Iterable, NamedTuple, Optional
|
||||
from typing import Iterable, List, NamedTuple, Optional
|
||||
import sys
|
||||
|
||||
class _RequestRate(NamedTuple):
|
||||
@@ -18,3 +18,5 @@ class RobotFileParser:
|
||||
if sys.version_info >= (3, 6):
|
||||
def crawl_delay(self, useragent: str) -> Optional[str]: ...
|
||||
def request_rate(self, useragent: str) -> Optional[_RequestRate]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def site_maps(self) -> Optional[List[str]]: ...
|
||||
|
||||
Reference in New Issue
Block a user