mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
Use variable annotations everywhere (#2909)
This commit is contained in:
committed by
Sebastian Rittau
parent
b3c76aab49
commit
efb67946f8
@@ -7,8 +7,8 @@ if sys.version_info >= (3, 5):
|
||||
|
||||
def __init__(self, *a) -> None: ...
|
||||
|
||||
phrase = ... # type: str
|
||||
description = ... # type: str
|
||||
phrase: str
|
||||
description: str
|
||||
|
||||
CONTINUE = ...
|
||||
SWITCHING_PROTOCOLS = ...
|
||||
|
||||
@@ -15,81 +15,81 @@ import types
|
||||
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
|
||||
_T = TypeVar('_T')
|
||||
|
||||
HTTP_PORT = ... # type: int
|
||||
HTTPS_PORT = ... # type: int
|
||||
HTTP_PORT: int
|
||||
HTTPS_PORT: int
|
||||
|
||||
CONTINUE = ... # type: int
|
||||
SWITCHING_PROTOCOLS = ... # type: int
|
||||
PROCESSING = ... # type: int
|
||||
CONTINUE: int
|
||||
SWITCHING_PROTOCOLS: int
|
||||
PROCESSING: int
|
||||
|
||||
OK = ... # type: int
|
||||
CREATED = ... # type: int
|
||||
ACCEPTED = ... # type: int
|
||||
NON_AUTHORITATIVE_INFORMATION = ... # type: int
|
||||
NO_CONTENT = ... # type: int
|
||||
RESET_CONTENT = ... # type: int
|
||||
PARTIAL_CONTENT = ... # type: int
|
||||
MULTI_STATUS = ... # type: int
|
||||
IM_USED = ... # type: int
|
||||
OK: int
|
||||
CREATED: int
|
||||
ACCEPTED: int
|
||||
NON_AUTHORITATIVE_INFORMATION: int
|
||||
NO_CONTENT: int
|
||||
RESET_CONTENT: int
|
||||
PARTIAL_CONTENT: int
|
||||
MULTI_STATUS: int
|
||||
IM_USED: int
|
||||
|
||||
MULTIPLE_CHOICES = ... # type: int
|
||||
MOVED_PERMANENTLY = ... # type: int
|
||||
FOUND = ... # type: int
|
||||
SEE_OTHER = ... # type: int
|
||||
NOT_MODIFIED = ... # type: int
|
||||
USE_PROXY = ... # type: int
|
||||
TEMPORARY_REDIRECT = ... # type: int
|
||||
MULTIPLE_CHOICES: int
|
||||
MOVED_PERMANENTLY: int
|
||||
FOUND: int
|
||||
SEE_OTHER: int
|
||||
NOT_MODIFIED: int
|
||||
USE_PROXY: int
|
||||
TEMPORARY_REDIRECT: int
|
||||
|
||||
BAD_REQUEST = ... # type: int
|
||||
UNAUTHORIZED = ... # type: int
|
||||
PAYMENT_REQUIRED = ... # type: int
|
||||
FORBIDDEN = ... # type: int
|
||||
NOT_FOUND = ... # type: int
|
||||
METHOD_NOT_ALLOWED = ... # type: int
|
||||
NOT_ACCEPTABLE = ... # type: int
|
||||
PROXY_AUTHENTICATION_REQUIRED = ... # type: int
|
||||
REQUEST_TIMEOUT = ... # type: int
|
||||
CONFLICT = ... # type: int
|
||||
GONE = ... # type: int
|
||||
LENGTH_REQUIRED = ... # type: int
|
||||
PRECONDITION_FAILED = ... # type: int
|
||||
REQUEST_ENTITY_TOO_LARGE = ... # type: int
|
||||
REQUEST_URI_TOO_LONG = ... # type: int
|
||||
UNSUPPORTED_MEDIA_TYPE = ... # type: int
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE = ... # type: int
|
||||
EXPECTATION_FAILED = ... # type: int
|
||||
UNPROCESSABLE_ENTITY = ... # type: int
|
||||
LOCKED = ... # type: int
|
||||
FAILED_DEPENDENCY = ... # type: int
|
||||
UPGRADE_REQUIRED = ... # type: int
|
||||
PRECONDITION_REQUIRED = ... # type: int
|
||||
TOO_MANY_REQUESTS = ... # type: int
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE = ... # type: int
|
||||
BAD_REQUEST: int
|
||||
UNAUTHORIZED: int
|
||||
PAYMENT_REQUIRED: int
|
||||
FORBIDDEN: int
|
||||
NOT_FOUND: int
|
||||
METHOD_NOT_ALLOWED: int
|
||||
NOT_ACCEPTABLE: int
|
||||
PROXY_AUTHENTICATION_REQUIRED: int
|
||||
REQUEST_TIMEOUT: int
|
||||
CONFLICT: int
|
||||
GONE: int
|
||||
LENGTH_REQUIRED: int
|
||||
PRECONDITION_FAILED: int
|
||||
REQUEST_ENTITY_TOO_LARGE: int
|
||||
REQUEST_URI_TOO_LONG: int
|
||||
UNSUPPORTED_MEDIA_TYPE: int
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE: int
|
||||
EXPECTATION_FAILED: int
|
||||
UNPROCESSABLE_ENTITY: int
|
||||
LOCKED: int
|
||||
FAILED_DEPENDENCY: int
|
||||
UPGRADE_REQUIRED: int
|
||||
PRECONDITION_REQUIRED: int
|
||||
TOO_MANY_REQUESTS: int
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE: int
|
||||
|
||||
INTERNAL_SERVER_ERROR = ... # type: int
|
||||
NOT_IMPLEMENTED = ... # type: int
|
||||
BAD_GATEWAY = ... # type: int
|
||||
SERVICE_UNAVAILABLE = ... # type: int
|
||||
GATEWAY_TIMEOUT = ... # type: int
|
||||
HTTP_VERSION_NOT_SUPPORTED = ... # type: int
|
||||
INSUFFICIENT_STORAGE = ... # type: int
|
||||
NOT_EXTENDED = ... # type: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED = ... # type: int
|
||||
INTERNAL_SERVER_ERROR: int
|
||||
NOT_IMPLEMENTED: int
|
||||
BAD_GATEWAY: int
|
||||
SERVICE_UNAVAILABLE: int
|
||||
GATEWAY_TIMEOUT: int
|
||||
HTTP_VERSION_NOT_SUPPORTED: int
|
||||
INSUFFICIENT_STORAGE: int
|
||||
NOT_EXTENDED: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
|
||||
responses = ... # type: Dict[int, str]
|
||||
responses: Dict[int, str]
|
||||
|
||||
class HTTPMessage(email.message.Message): ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
# Ignore errors to work around python/mypy#5027
|
||||
class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore
|
||||
msg = ... # type: HTTPMessage
|
||||
headers = ... # type: HTTPMessage
|
||||
version = ... # type: int
|
||||
debuglevel = ... # type: int
|
||||
closed = ... # type: bool
|
||||
status = ... # type: int
|
||||
reason = ... # type: str
|
||||
msg: HTTPMessage
|
||||
headers: HTTPMessage
|
||||
version: int
|
||||
debuglevel: int
|
||||
closed: bool
|
||||
status: int
|
||||
reason: str
|
||||
def __init__(self, sock: socket, debuglevel: int = ...,
|
||||
method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
|
||||
def read(self, amt: Optional[int] = ...) -> bytes: ...
|
||||
@@ -111,13 +111,13 @@ if sys.version_info >= (3, 5):
|
||||
def begin(self) -> None: ...
|
||||
else:
|
||||
class HTTPResponse(io.RawIOBase, BinaryIO): # type: ignore
|
||||
msg = ... # type: HTTPMessage
|
||||
headers = ... # type: HTTPMessage
|
||||
version = ... # type: int
|
||||
debuglevel = ... # type: int
|
||||
closed = ... # type: bool
|
||||
status = ... # type: int
|
||||
reason = ... # type: str
|
||||
msg: HTTPMessage
|
||||
headers: HTTPMessage
|
||||
version: int
|
||||
debuglevel: int
|
||||
closed: bool
|
||||
status: int
|
||||
reason: str
|
||||
def read(self, amt: Optional[int] = ...) -> bytes: ...
|
||||
def readinto(self, b: bytearray) -> int: ...
|
||||
@overload
|
||||
|
||||
@@ -25,8 +25,8 @@ class CookieJar(Iterable[Cookie]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
class FileCookieJar(CookieJar):
|
||||
filename = ... # type: str
|
||||
delayload = ... # type: bool
|
||||
filename: str
|
||||
delayload: bool
|
||||
def __init__(self, filename: str = ..., delayload: bool = ...,
|
||||
policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
def save(self, filename: Optional[str] = ..., ignore_discard: bool = ...,
|
||||
@@ -41,9 +41,9 @@ class LWPCookieJar(FileCookieJar): ...
|
||||
|
||||
|
||||
class CookiePolicy:
|
||||
netscape = ... # type: bool
|
||||
rfc2965 = ... # type: bool
|
||||
hide_cookie2 = ... # type: bool
|
||||
netscape: bool
|
||||
rfc2965: bool
|
||||
hide_cookie2: bool
|
||||
def set_ok(self, cookie: Cookie, request: Request) -> bool: ...
|
||||
def return_ok(self, cookie: Cookie, request: Request) -> bool: ...
|
||||
def domain_return_ok(self, domain: str, request: Request) -> bool: ...
|
||||
@@ -51,18 +51,18 @@ class CookiePolicy:
|
||||
|
||||
|
||||
class DefaultCookiePolicy(CookiePolicy):
|
||||
rfc2109_as_netscape = ... # type: bool
|
||||
strict_domain = ... # type: bool
|
||||
strict_rfc2965_unverifiable = ... # type: bool
|
||||
strict_ns_unverifiable = ... # type: bool
|
||||
strict_ns_domain = ... # type: int
|
||||
strict_ns_set_initial_dollar = ... # type: bool
|
||||
strict_ns_set_path = ... # type: bool
|
||||
DomainStrictNoDots = ... # type: int
|
||||
DomainStrictNonDomain = ... # type: int
|
||||
DomainRFC2965Match = ... # type: int
|
||||
DomainLiberal = ... # type: int
|
||||
DomainStrict = ... # type: int
|
||||
rfc2109_as_netscape: bool
|
||||
strict_domain: bool
|
||||
strict_rfc2965_unverifiable: bool
|
||||
strict_ns_unverifiable: bool
|
||||
strict_ns_domain: int
|
||||
strict_ns_set_initial_dollar: bool
|
||||
strict_ns_set_path: bool
|
||||
DomainStrictNoDots: int
|
||||
DomainStrictNonDomain: int
|
||||
DomainRFC2965Match: int
|
||||
DomainLiberal: int
|
||||
DomainStrict: int
|
||||
def __init__(self, blocked_domains: Optional[Sequence[str]] = ...,
|
||||
allowed_domains: Optional[Sequence[str]] = ...,
|
||||
netscape: bool = ...,
|
||||
@@ -83,20 +83,20 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
|
||||
|
||||
class Cookie:
|
||||
version = ... # type: Optional[int]
|
||||
name = ... # type: str
|
||||
value = ... # type: Optional[str]
|
||||
port = ... # type: Optional[str]
|
||||
path = ... # type: str
|
||||
secure = ... # type: bool
|
||||
expires = ... # type: Optional[int]
|
||||
discard = ... # type: bool
|
||||
comment = ... # type: Optional[str]
|
||||
comment_url = ... # type: Optional[str]
|
||||
rfc2109 = ... # type: bool
|
||||
port_specified = ... # type: bool
|
||||
domain_specified = ... # type: bool
|
||||
domain_initial_dot = ... # type: bool
|
||||
version: Optional[int]
|
||||
name: str
|
||||
value: Optional[str]
|
||||
port: Optional[str]
|
||||
path: str
|
||||
secure: bool
|
||||
expires: Optional[int]
|
||||
discard: bool
|
||||
comment: Optional[str]
|
||||
comment_url: Optional[str]
|
||||
rfc2109: bool
|
||||
port_specified: bool
|
||||
domain_specified: bool
|
||||
domain_initial_dot: bool
|
||||
def has_nonstandard_attr(self, name: str) -> bool: ...
|
||||
@overload
|
||||
def get_nonstandard_attr(self, name: str) -> Optional[str]: ...
|
||||
|
||||
@@ -8,9 +8,9 @@ _T = TypeVar('_T')
|
||||
class CookieError(Exception): ...
|
||||
|
||||
class Morsel(Dict[str, str], Generic[_T]):
|
||||
value = ... # type: str
|
||||
coded_value = ... # type: _T
|
||||
key = ... # type: str
|
||||
value: str
|
||||
coded_value: _T
|
||||
key: str
|
||||
def set(self, key: str, val: str, coded_val: _T) -> None: ...
|
||||
def isReservedKey(self, K: str) -> bool: ...
|
||||
def output(self, attrs: Optional[List[str]] = ...,
|
||||
|
||||
@@ -9,29 +9,29 @@ if sys.version_info >= (3, 7):
|
||||
from builtins import _PathLike
|
||||
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
server_name = ... # type: str
|
||||
server_port = ... # type: int
|
||||
server_name: str
|
||||
server_port: int
|
||||
def __init__(self, server_address: Tuple[str, int],
|
||||
RequestHandlerClass: type) -> None: ...
|
||||
|
||||
class BaseHTTPRequestHandler:
|
||||
client_address = ... # type: Tuple[str, int]
|
||||
server = ... # type: socketserver.BaseServer
|
||||
close_connection = ... # type: bool
|
||||
requestline = ... # type: str
|
||||
command = ... # type: str
|
||||
path = ... # type: str
|
||||
request_version = ... # type: str
|
||||
headers = ... # type: email.message.Message
|
||||
rfile = ... # type: BinaryIO
|
||||
wfile = ... # type: BinaryIO
|
||||
server_version = ... # type: str
|
||||
sys_version = ... # type: str
|
||||
error_message_format = ... # type: str
|
||||
error_content_type = ... # type: str
|
||||
protocol_version = ... # type: str
|
||||
MessageClass = ... # type: type
|
||||
responses = ... # type: Mapping[int, Tuple[str, str]]
|
||||
client_address: Tuple[str, int]
|
||||
server: socketserver.BaseServer
|
||||
close_connection: bool
|
||||
requestline: str
|
||||
command: str
|
||||
path: str
|
||||
request_version: str
|
||||
headers: email.message.Message
|
||||
rfile: BinaryIO
|
||||
wfile: BinaryIO
|
||||
server_version: str
|
||||
sys_version: str
|
||||
error_message_format: str
|
||||
error_content_type: str
|
||||
protocol_version: str
|
||||
MessageClass: type
|
||||
responses: Mapping[int, Tuple[str, str]]
|
||||
def __init__(self, request: bytes, client_address: Tuple[str, int],
|
||||
server: socketserver.BaseServer) -> None: ...
|
||||
def handle(self) -> None: ...
|
||||
@@ -56,7 +56,7 @@ class BaseHTTPRequestHandler:
|
||||
def address_string(self) -> str: ...
|
||||
|
||||
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
extensions_map = ... # type: Dict[str, str]
|
||||
extensions_map: Dict[str, str]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(self, request: bytes, client_address: Tuple[str, int],
|
||||
server: socketserver.BaseServer, directory: Optional[Union[str, _PathLike[str]]]) -> None: ...
|
||||
@@ -67,5 +67,5 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
def do_HEAD(self) -> None: ...
|
||||
|
||||
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
|
||||
cgi_directories = ... # type: List[str]
|
||||
cgi_directories: List[str]
|
||||
def do_POST(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user