mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Use variable annotations everywhere (#2909)
This commit is contained in:
committed by
Sebastian Rittau
parent
b3c76aab49
commit
efb67946f8
@@ -18,42 +18,42 @@ _hostDesc = Union[str, Tuple[str, Mapping[Any, Any]]]
|
||||
|
||||
def escape(s: AnyStr, replace: Callable[[AnyStr, AnyStr, AnyStr], AnyStr] = ...) -> AnyStr: ...
|
||||
|
||||
MAXINT = ... # type: int
|
||||
MININT = ... # type: int
|
||||
PARSE_ERROR = ... # type: int
|
||||
SERVER_ERROR = ... # type: int
|
||||
APPLICATION_ERROR = ... # type: int
|
||||
SYSTEM_ERROR = ... # type: int
|
||||
TRANSPORT_ERROR = ... # type: int
|
||||
NOT_WELLFORMED_ERROR = ... # type: int
|
||||
UNSUPPORTED_ENCODING = ... # type: int
|
||||
INVALID_ENCODING_CHAR = ... # type: int
|
||||
INVALID_XMLRPC = ... # type: int
|
||||
METHOD_NOT_FOUND = ... # type: int
|
||||
INVALID_METHOD_PARAMS = ... # type: int
|
||||
INTERNAL_ERROR = ... # type: int
|
||||
MAXINT: int
|
||||
MININT: int
|
||||
PARSE_ERROR: int
|
||||
SERVER_ERROR: int
|
||||
APPLICATION_ERROR: int
|
||||
SYSTEM_ERROR: int
|
||||
TRANSPORT_ERROR: int
|
||||
NOT_WELLFORMED_ERROR: int
|
||||
UNSUPPORTED_ENCODING: int
|
||||
INVALID_ENCODING_CHAR: int
|
||||
INVALID_XMLRPC: int
|
||||
METHOD_NOT_FOUND: int
|
||||
INVALID_METHOD_PARAMS: int
|
||||
INTERNAL_ERROR: int
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
class ProtocolError(Error):
|
||||
url = ... # type: str
|
||||
errcode = ... # type: int
|
||||
errmsg = ... # type: str
|
||||
headers = ... # type: Any
|
||||
url: str
|
||||
errcode: int
|
||||
errmsg: str
|
||||
headers: Any
|
||||
def __init__(self, url: str, errcode: int, errmsg: str, headers: Any) -> None: ...
|
||||
|
||||
class ResponseError(Error): ...
|
||||
|
||||
class Fault(Error):
|
||||
faultCode = ... # type: Any
|
||||
faultString = ... # type: str
|
||||
faultCode: Any
|
||||
faultString: str
|
||||
def __init__(self, faultCode: Any, faultString: str, **extra: Any) -> None: ...
|
||||
|
||||
boolean = ... # type: Type[bool]
|
||||
Boolean = ... # type: Type[bool]
|
||||
boolean: Type[bool]
|
||||
Boolean: Type[bool]
|
||||
|
||||
class DateTime:
|
||||
value = ... # type: str
|
||||
value: str
|
||||
def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ...
|
||||
def make_comparable(self, other: _dateTimeComp) -> Tuple[_dateTimeComp, _dateTimeComp]: ...
|
||||
def __lt__(self, other: _dateTimeComp) -> bool: ...
|
||||
@@ -68,18 +68,18 @@ class DateTime:
|
||||
def encode(self, out: IO) -> None: ...
|
||||
|
||||
class Binary:
|
||||
data = ... # type: str
|
||||
data: str
|
||||
def __init__(self, data: Optional[str] = ...) -> None: ...
|
||||
def __cmp__(self, other: Any) -> int: ...
|
||||
def decode(self, data: str) -> None: ...
|
||||
def encode(self, out: IO) -> None: ...
|
||||
|
||||
WRAPPERS = ... # type: tuple
|
||||
WRAPPERS: tuple
|
||||
|
||||
# Still part of the public API, but see http://bugs.python.org/issue1773632
|
||||
FastParser = ... # type: None
|
||||
FastUnmarshaller = ... # type: None
|
||||
FastMarshaller = ... # type: None
|
||||
FastParser: None
|
||||
FastUnmarshaller: None
|
||||
FastMarshaller: None
|
||||
|
||||
# xmlrpclib.py will leave ExpatParser undefined if it can't import expat from
|
||||
# xml.parsers. Because this is Python 2.7, the import will succeed.
|
||||
@@ -90,20 +90,20 @@ class ExpatParser:
|
||||
|
||||
# TODO: Add xmllib.XMLParser as base class
|
||||
class SlowParser:
|
||||
handle_xml = ... # type: Callable[[str, bool], None]
|
||||
unknown_starttag = ... # type: Callable[[str, Any], None]
|
||||
handle_data = ... # type: Callable[[str], None]
|
||||
handle_cdata = ... # type: Callable[[str], None]
|
||||
unknown_endtag = ... # type: Callable[[str, Callable[[Iterable[str], str], str]], None]
|
||||
handle_xml: Callable[[str, bool], None]
|
||||
unknown_starttag: Callable[[str, Any], None]
|
||||
handle_data: Callable[[str], None]
|
||||
handle_cdata: Callable[[str], None]
|
||||
unknown_endtag: Callable[[str, Callable[[Iterable[str], str], str]], None]
|
||||
def __init__(self, target: _Unmarshaller) -> None: ...
|
||||
|
||||
class Marshaller:
|
||||
memo = ... # type: MutableMapping[int, Any]
|
||||
data = ... # type: Optional[str]
|
||||
encoding = ... # type: Optional[str]
|
||||
allow_none = ... # type: bool
|
||||
memo: MutableMapping[int, Any]
|
||||
data: Optional[str]
|
||||
encoding: Optional[str]
|
||||
allow_none: bool
|
||||
def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ...
|
||||
dispatch = ... # type: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]]
|
||||
dispatch: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]]
|
||||
def dumps(self, values: Union[Iterable[Union[None, int, bool, long, float, str, unicode, List, Tuple, Mapping, datetime, InstanceType]], Fault]) -> str: ...
|
||||
def dump_nil(self, value: None, write: Callable[[str], None]) -> None: ...
|
||||
def dump_int(self, value: int, write: Callable[[str], None]) -> None: ...
|
||||
@@ -127,7 +127,7 @@ class Unmarshaller:
|
||||
def data(self, text: str) -> None: ...
|
||||
def end(self, tag: str, join: Callable[[Iterable[str], str], str] = ...) -> None: ...
|
||||
def end_dispatch(self, tag: str, data: str) -> None: ...
|
||||
dispatch = ... # type: Mapping[str, Callable[[Unmarshaller, str], None]]
|
||||
dispatch: Mapping[str, Callable[[Unmarshaller, str], None]]
|
||||
def end_nil(self, data: str): ...
|
||||
def end_boolean(self, data: str) -> None: ...
|
||||
def end_int(self, data: str) -> None: ...
|
||||
@@ -160,7 +160,7 @@ def gzip_encode(data: str) -> str: ...
|
||||
def gzip_decode(data: str, max_decode: int = ...) -> str: ...
|
||||
|
||||
class GzipDecodedResponse(GzipFile):
|
||||
stringio = ... # type: StringIO
|
||||
stringio: StringIO
|
||||
def __init__(self, response: HTTPResponse) -> None: ...
|
||||
def close(self): ...
|
||||
|
||||
@@ -170,12 +170,12 @@ class _Method:
|
||||
def __call__(self, *args: Any) -> Any: ...
|
||||
|
||||
class Transport:
|
||||
user_agent = ... # type: str
|
||||
accept_gzip_encoding = ... # type: bool
|
||||
encode_threshold = ... # type: Optional[int]
|
||||
user_agent: str
|
||||
accept_gzip_encoding: bool
|
||||
encode_threshold: Optional[int]
|
||||
def __init__(self, use_datetime: bool = ...) -> None: ...
|
||||
def request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ...
|
||||
verbose = ... # type: bool
|
||||
verbose: bool
|
||||
def single_request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ...
|
||||
def getparser(self) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ...
|
||||
def get_host_info(self, host: _hostDesc) -> Tuple[str, Optional[List[Tuple[str, str]]], Optional[Mapping[Any, Any]]]: ...
|
||||
|
||||
Reference in New Issue
Block a user