mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Misc. changes to help pytype parse typeshed (#382)
This commit is contained in:
committed by
Matthias Kramm
parent
368c703078
commit
e02332a787
@@ -22,7 +22,7 @@ SOCK_CLOEXEC = 0
|
||||
SOCK_NONBLOCK = 0
|
||||
SOMAXCONN = 0
|
||||
has_ipv6 = False
|
||||
_GLOBAL_DEFAULT_TIMEOUT = 0.0
|
||||
_GLOBAL_DEFAULT_TIMEOUT = ... # type: Any
|
||||
SocketType = ... # type: Any
|
||||
SocketIO = ... # type: Any
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class Connection:
|
||||
def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ...
|
||||
def create_collation(self, name: str, callable: Any) -> None: ...
|
||||
def create_function(self, name: str, num_params: int, func: Any) -> None: ...
|
||||
def cursor(self, cursorClass= Union[type, None]) -> Cursor: ...
|
||||
def cursor(self, cursorClass=...) -> Cursor: ...
|
||||
def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ...
|
||||
# TODO: please check in executemany() if seq_of_parameters type is possible like this
|
||||
def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ...
|
||||
|
||||
@@ -11,8 +11,8 @@ def enumerate() -> List[Thread]: ...
|
||||
|
||||
class Thread(object):
|
||||
name = ... # type: str
|
||||
ident = 0
|
||||
daemon = False
|
||||
ident = ... # type: Optional[int]
|
||||
daemon = ... # type: bool
|
||||
|
||||
def __init__(self, group: Any = ..., target: Callable[..., Any] = ...,
|
||||
name: str = ..., args: Sequence[Any] = ...,
|
||||
|
||||
@@ -61,8 +61,10 @@ class HTTPRedirectHandler(BaseHandler):
|
||||
max_repeats = ... # int
|
||||
max_redirections = ... # int
|
||||
def redirect_request(self, req, fp, code, msg, headers, newurl): ...
|
||||
def http_error_301(self, req, fp, code, msg, headers): ...
|
||||
def http_error_302(self, req, fp, code, msg, headers): ...
|
||||
http_error_301 = http_error_303 = http_error_307 = http_error_302
|
||||
def http_error_303(self, req, fp, code, msg, headers): ...
|
||||
def http_error_307(self, req, fp, code, msg, headers): ...
|
||||
inf_msg = ... # type: str
|
||||
|
||||
|
||||
@@ -120,12 +122,12 @@ class AbstractHTTPHandler(BaseHandler):
|
||||
|
||||
class HTTPHandler(AbstractHTTPHandler):
|
||||
def http_open(self, req): ...
|
||||
http_request = AbstractHTTPHandler.do_request_
|
||||
def http_request(self, request): ...
|
||||
|
||||
class HTTPSHandler(AbstractHTTPHandler):
|
||||
def __init__(self, debuglevel=0, context=None): ...
|
||||
def https_open(self, req): ...
|
||||
https_request = AbstractHTTPHandler.do_request_
|
||||
def https_request(self, request): ...
|
||||
|
||||
class HTTPCookieProcessor(BaseHandler):
|
||||
def __init__(self, cookiejar=None): ...
|
||||
|
||||
Reference in New Issue
Block a user