mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
2.7 stub updates (#149)
* Stubgen modules for 2.7
Cookie
email._parseaddr
email.utils
genericpath
linecache
mimetypes
multiprocessing
multiprocessing.process
multiprocessing.util
posixpath
quopri
runpy
weakref
wsgiref.validate
* 2.7/typing.py: add missing __contains__ definition
* 2.7/subprocess.py: make output argument to CalledProcessError optional
Commit f08160bd did the same for py3.
* 2.7/hmac.pyi: add compare_digest
This function was introduced to the 2.7 series in 2.7.7.
* Stubgen 2.7/ssl.pyi
This replaces a nearly-empty handwritten stub.
* Copy constants and other definitions from py3 to py2 ssl.pyi
* 2.7/__future__.pyi: add methods
* 2.7/_weakref.pyi: backport some definitions from 3.x version
* Stubgen 2.7/locale.pyi
Hand-edited to remove declarations that are redundant (and cause
conflicts with) the "from _locale import *" line.
This commit is contained in:
committed by
Guido van Rossum
parent
fcef262a9b
commit
2ddbf901c9
44
stdlib/2.7/Cookie.pyi
Normal file
44
stdlib/2.7/Cookie.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
# Stubs for Cookie (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class CookieError(Exception): ...
|
||||
|
||||
class Morsel(dict):
|
||||
key = ... # type: Any
|
||||
def __init__(self): ...
|
||||
def __setitem__(self, K, V): ...
|
||||
def isReservedKey(self, K): ...
|
||||
value = ... # type: Any
|
||||
coded_value = ... # type: Any
|
||||
def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ...
|
||||
def output(self, attrs=None, header=''): ...
|
||||
def js_output(self, attrs=None): ...
|
||||
def OutputString(self, attrs=None): ...
|
||||
|
||||
class BaseCookie(dict):
|
||||
def value_decode(self, val): ...
|
||||
def value_encode(self, val): ...
|
||||
def __init__(self, input=None): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def output(self, attrs=None, header='', sep=''): ...
|
||||
def js_output(self, attrs=None): ...
|
||||
def load(self, rawdata): ...
|
||||
|
||||
class SimpleCookie(BaseCookie):
|
||||
def value_decode(self, val): ...
|
||||
def value_encode(self, val): ...
|
||||
|
||||
class SerialCookie(BaseCookie):
|
||||
def __init__(self, input=None): ...
|
||||
def value_decode(self, val): ...
|
||||
def value_encode(self, val): ...
|
||||
|
||||
class SmartCookie(BaseCookie):
|
||||
def __init__(self, input=None): ...
|
||||
def value_decode(self, val): ...
|
||||
def value_encode(self, val): ...
|
||||
|
||||
Cookie = ... # type: Any
|
||||
@@ -1,4 +1,8 @@
|
||||
class _Feature: ...
|
||||
from sys import _version_info
|
||||
|
||||
class _Feature:
|
||||
def getOptionalRelease(self) -> _version_info: ...
|
||||
def getMandatoryRelease(self) -> _version_info: ...
|
||||
|
||||
absolute_import = None # type: _Feature
|
||||
division = None # type: _Feature
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from typing import Any, Callable
|
||||
from typing import Any, Callable, Generic, Optional, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class CallableProxyType(object): # "weakcallableproxy"
|
||||
pass
|
||||
@@ -6,10 +8,13 @@ class CallableProxyType(object): # "weakcallableproxy"
|
||||
class ProxyType(object): # "weakproxy"
|
||||
pass
|
||||
|
||||
class ReferenceType(object): # "weakref"
|
||||
pass
|
||||
class ReferenceType(Generic[_T]):
|
||||
# TODO rest of members
|
||||
def __call__(self) -> Optional[_T]:
|
||||
...
|
||||
|
||||
ref = ReferenceType
|
||||
def ref(o: _T, callback: Callable[[ReferenceType[_T]],
|
||||
Any] = ...) -> ReferenceType[_T]: ...
|
||||
|
||||
def getweakrefcount(object: Any) -> int: ...
|
||||
def getweakrefs(object: Any) -> int: ...
|
||||
|
||||
44
stdlib/2.7/email/_parseaddr.pyi
Normal file
44
stdlib/2.7/email/_parseaddr.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
# Stubs for email._parseaddr (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
def parsedate_tz(data): ...
|
||||
def parsedate(data): ...
|
||||
def mktime_tz(data): ...
|
||||
def quote(str): ...
|
||||
|
||||
class AddrlistClass:
|
||||
specials = ... # type: Any
|
||||
pos = ... # type: Any
|
||||
LWS = ... # type: Any
|
||||
CR = ... # type: Any
|
||||
FWS = ... # type: Any
|
||||
atomends = ... # type: Any
|
||||
phraseends = ... # type: Any
|
||||
field = ... # type: Any
|
||||
commentlist = ... # type: Any
|
||||
def __init__(self, field): ...
|
||||
def gotonext(self): ...
|
||||
def getaddrlist(self): ...
|
||||
def getaddress(self): ...
|
||||
def getrouteaddr(self): ...
|
||||
def getaddrspec(self): ...
|
||||
def getdomain(self): ...
|
||||
def getdelimited(self, beginchar, endchars, allowcomments=True): ...
|
||||
def getquote(self): ...
|
||||
def getcomment(self): ...
|
||||
def getdomainliteral(self): ...
|
||||
def getatom(self, atomends=None): ...
|
||||
def getphraselist(self): ...
|
||||
|
||||
class AddressList(AddrlistClass):
|
||||
addresslist = ... # type: Any
|
||||
def __init__(self, field): ...
|
||||
def __len__(self): ...
|
||||
def __add__(self, other): ...
|
||||
def __iadd__(self, other): ...
|
||||
def __sub__(self, other): ...
|
||||
def __isub__(self, other): ...
|
||||
def __getitem__(self, index): ...
|
||||
22
stdlib/2.7/email/utils.pyi
Normal file
22
stdlib/2.7/email/utils.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
# Stubs for email.utils (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from email._parseaddr import AddressList as _AddressList
|
||||
from email._parseaddr import mktime_tz as mktime_tz
|
||||
from email._parseaddr import parsedate as _parsedate
|
||||
from email._parseaddr import parsedate_tz as _parsedate_tz
|
||||
from quopri import decodestring as _qdecode
|
||||
|
||||
def formataddr(pair): ...
|
||||
def getaddresses(fieldvalues): ...
|
||||
def formatdate(timeval=None, localtime=False, usegmt=False): ...
|
||||
def make_msgid(idstring=None): ...
|
||||
def parsedate(data): ...
|
||||
def parsedate_tz(data): ...
|
||||
def parseaddr(addr): ...
|
||||
def unquote(str): ...
|
||||
def decode_rfc2231(s): ...
|
||||
def encode_rfc2231(s, charset=None, language=None): ...
|
||||
def decode_params(params): ...
|
||||
def collapse_rfc2231_value(value, errors='', fallback_charset=''): ...
|
||||
14
stdlib/2.7/genericpath.pyi
Normal file
14
stdlib/2.7/genericpath.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
# Stubs for genericpath (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
class _unicode: ...
|
||||
|
||||
def exists(path): ...
|
||||
def isfile(path): ...
|
||||
def isdir(s): ...
|
||||
def getsize(filename): ...
|
||||
def getmtime(filename): ...
|
||||
def getatime(filename): ...
|
||||
def getctime(filename): ...
|
||||
def commonprefix(m): ...
|
||||
@@ -1,6 +1,6 @@
|
||||
# Stubs for hmac (Python 2)
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, AnyStr
|
||||
|
||||
class HMAC:
|
||||
def update(self, msg: str) -> None: ...
|
||||
@@ -9,3 +9,5 @@ class HMAC:
|
||||
def copy(self) -> HMAC: ...
|
||||
|
||||
def new(key: str, msg: str = ..., digestmod: Any = ...) -> HMAC: ...
|
||||
|
||||
def compare_digest(a: AnyStr, b: AnyStr) -> bool: ...
|
||||
|
||||
7
stdlib/2.7/linecache.pyi
Normal file
7
stdlib/2.7/linecache.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
# Stubs for linecache (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
def getline(filename, lineno, module_globals=None): ...
|
||||
def clearcache(): ...
|
||||
def checkcache(filename=None): ...
|
||||
33
stdlib/2.7/locale.pyi
Normal file
33
stdlib/2.7/locale.pyi
Normal file
@@ -0,0 +1,33 @@
|
||||
# Stubs for locale (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from _locale import *
|
||||
|
||||
class _unicode: ...
|
||||
|
||||
CHAR_MAX = ... # type: Any
|
||||
LC_ALL = ... # type: Any
|
||||
LC_COLLATE = ... # type: Any
|
||||
LC_CTYPE = ... # type: Any
|
||||
LC_MESSAGES = ... # type: Any
|
||||
LC_MONETARY = ... # type: Any
|
||||
LC_NUMERIC = ... # type: Any
|
||||
LC_TIME = ... # type: Any
|
||||
Error = ... # type: Any
|
||||
|
||||
def localeconv(): ...
|
||||
def strcoll(a, b): ...
|
||||
def strxfrm(s): ...
|
||||
def format(percent, value, grouping=False, monetary=False, *additional): ...
|
||||
def format_string(f, val, grouping=False): ...
|
||||
def currency(val, symbol=True, grouping=False, international=False): ...
|
||||
def str(val): ...
|
||||
def atof(string, func=...): ...
|
||||
def atoi(str): ...
|
||||
def normalize(localename): ...
|
||||
def getdefaultlocale(envvars=...): ...
|
||||
def getlocale(category=...): ...
|
||||
def resetlocale(category=...): ...
|
||||
def getpreferredencoding(do_setlocale=True): ...
|
||||
26
stdlib/2.7/mimetypes.pyi
Normal file
26
stdlib/2.7/mimetypes.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
# Stubs for mimetypes (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class MimeTypes:
|
||||
encodings_map = ... # type: Any
|
||||
suffix_map = ... # type: Any
|
||||
types_map = ... # type: Any
|
||||
types_map_inv = ... # type: Any
|
||||
def __init__(self, filenames=..., strict=True): ...
|
||||
def add_type(self, type, ext, strict=True): ...
|
||||
def guess_type(self, url, strict=True): ...
|
||||
def guess_all_extensions(self, type, strict=True): ...
|
||||
def guess_extension(self, type, strict=True): ...
|
||||
def read(self, filename, strict=True): ...
|
||||
def readfp(self, fp, strict=True): ...
|
||||
def read_windows_registry(self, strict=True): ...
|
||||
|
||||
def guess_type(url, strict=True): ...
|
||||
def guess_all_extensions(type, strict=True): ...
|
||||
def guess_extension(type, strict=True): ...
|
||||
def add_type(type, ext, strict=True): ...
|
||||
def init(files=None): ...
|
||||
def read_mime_types(file): ...
|
||||
32
stdlib/2.7/multiprocessing/__init__.pyi
Normal file
32
stdlib/2.7/multiprocessing/__init__.pyi
Normal file
@@ -0,0 +1,32 @@
|
||||
# Stubs for multiprocessing (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children
|
||||
from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING
|
||||
|
||||
class ProcessError(Exception): ...
|
||||
class BufferTooShort(ProcessError): ...
|
||||
class TimeoutError(ProcessError): ...
|
||||
class AuthenticationError(ProcessError): ...
|
||||
|
||||
def Manager(): ...
|
||||
def Pipe(duplex=True): ...
|
||||
def cpu_count(): ...
|
||||
def freeze_support(): ...
|
||||
def get_logger(): ...
|
||||
def log_to_stderr(level=None): ...
|
||||
def allow_connection_pickling(): ...
|
||||
def Lock(): ...
|
||||
def RLock(): ...
|
||||
def Condition(lock=None): ...
|
||||
def Semaphore(value=1): ...
|
||||
def BoundedSemaphore(value=1): ...
|
||||
def Event(): ...
|
||||
def Queue(maxsize=0): ...
|
||||
def JoinableQueue(maxsize=0): ...
|
||||
def Pool(processes=None, initializer=None, initargs=..., maxtasksperchild=None): ...
|
||||
def RawValue(typecode_or_type, *args): ...
|
||||
def RawArray(typecode_or_type, size_or_initializer): ...
|
||||
def Value(typecode_or_type, *args, **kwds): ...
|
||||
def Array(typecode_or_type, size_or_initializer, **kwds): ...
|
||||
39
stdlib/2.7/multiprocessing/process.pyi
Normal file
39
stdlib/2.7/multiprocessing/process.pyi
Normal file
@@ -0,0 +1,39 @@
|
||||
# Stubs for multiprocessing.process (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
def current_process(): ...
|
||||
def active_children(): ...
|
||||
|
||||
class Process:
|
||||
def __init__(self, group=None, target=None, name=None, args=..., kwargs=...): ...
|
||||
def run(self): ...
|
||||
def start(self): ...
|
||||
def terminate(self): ...
|
||||
def join(self, timeout=None): ...
|
||||
def is_alive(self): ...
|
||||
@property
|
||||
def name(self): ...
|
||||
@name.setter
|
||||
def name(self, name): ...
|
||||
@property
|
||||
def daemon(self): ...
|
||||
@daemon.setter
|
||||
def daemon(self, daemonic): ...
|
||||
@property
|
||||
def authkey(self): ...
|
||||
@authkey.setter
|
||||
def authkey(self, authkey): ...
|
||||
@property
|
||||
def exitcode(self): ...
|
||||
@property
|
||||
def ident(self): ...
|
||||
pid = ... # type: Any
|
||||
|
||||
class AuthenticationString(bytes):
|
||||
def __reduce__(self): ...
|
||||
|
||||
class _MainProcess(Process):
|
||||
def __init__(self): ...
|
||||
33
stdlib/2.7/multiprocessing/util.pyi
Normal file
33
stdlib/2.7/multiprocessing/util.pyi
Normal file
@@ -0,0 +1,33 @@
|
||||
# Stubs for multiprocessing.util (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
import threading
|
||||
|
||||
SUBDEBUG = ... # type: Any
|
||||
SUBWARNING = ... # type: Any
|
||||
|
||||
def sub_debug(msg, *args): ...
|
||||
def debug(msg, *args): ...
|
||||
def info(msg, *args): ...
|
||||
def sub_warning(msg, *args): ...
|
||||
def get_logger(): ...
|
||||
def log_to_stderr(level=None): ...
|
||||
def get_temp_dir(): ...
|
||||
def register_after_fork(obj, func): ...
|
||||
|
||||
class Finalize:
|
||||
def __init__(self, obj, callback, args=..., kwargs=None, exitpriority=None): ...
|
||||
def __call__(self, wr=None): ...
|
||||
def cancel(self): ...
|
||||
def still_active(self): ...
|
||||
|
||||
def is_exiting(): ...
|
||||
|
||||
class ForkAwareThreadLock:
|
||||
def __init__(self): ...
|
||||
|
||||
class ForkAwareLocal(threading.local):
|
||||
def __init__(self): ...
|
||||
def __reduce__(self): ...
|
||||
50
stdlib/2.7/posixpath.pyi
Normal file
50
stdlib/2.7/posixpath.pyi
Normal file
@@ -0,0 +1,50 @@
|
||||
# Stubs for posixpath (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from genericpath import *
|
||||
|
||||
curdir = ... # type: Any
|
||||
pardir = ... # type: Any
|
||||
extsep = ... # type: Any
|
||||
sep = ... # type: Any
|
||||
pathsep = ... # type: Any
|
||||
defpath = ... # type: Any
|
||||
altsep = ... # type: Any
|
||||
devnull = ... # type: Any
|
||||
|
||||
def normcase(s): ...
|
||||
def isabs(s): ...
|
||||
def join(a, *p): ...
|
||||
def split(p): ...
|
||||
def splitext(p): ...
|
||||
def splitdrive(p): ...
|
||||
def basename(p): ...
|
||||
def dirname(p): ...
|
||||
def islink(path): ...
|
||||
def lexists(path): ...
|
||||
def samefile(f1, f2): ...
|
||||
def sameopenfile(fp1, fp2): ...
|
||||
def samestat(s1, s2): ...
|
||||
def ismount(path): ...
|
||||
def walk(top, func, arg): ...
|
||||
def expanduser(path): ...
|
||||
def expandvars(path): ...
|
||||
def normpath(path): ...
|
||||
def abspath(path): ...
|
||||
def realpath(filename): ...
|
||||
|
||||
supports_unicode_filenames = ... # type: Any
|
||||
|
||||
def relpath(path, start=...): ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# commonprefix
|
||||
# exists
|
||||
# getatime
|
||||
# getctime
|
||||
# getmtime
|
||||
# getsize
|
||||
# isdir
|
||||
# isfile
|
||||
8
stdlib/2.7/quopri.pyi
Normal file
8
stdlib/2.7/quopri.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
# Stubs for quopri (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
def encode(input, output, quotetabs, header=0): ...
|
||||
def encodestring(s, quotetabs=0, header=0): ...
|
||||
def decode(input, output, header=0): ...
|
||||
def decodestring(s, header=0): ...
|
||||
21
stdlib/2.7/runpy.pyi
Normal file
21
stdlib/2.7/runpy.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
# Stubs for runpy (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class _TempModule:
|
||||
mod_name = ... # type: Any
|
||||
module = ... # type: Any
|
||||
def __init__(self, mod_name): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class _ModifiedArgv0:
|
||||
value = ... # type: Any
|
||||
def __init__(self, value): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
def run_module(mod_name, init_globals=None, run_name=None, alter_sys=False): ...
|
||||
def run_path(path_name, init_globals=None, run_name=None): ...
|
||||
@@ -1,5 +1,190 @@
|
||||
# Stubs for ssl (incomplete)
|
||||
# Stubs for ssl (Python 2)
|
||||
|
||||
import socket
|
||||
from typing import Any
|
||||
from socket import socket, error as socket_error
|
||||
from collections import namedtuple
|
||||
|
||||
class SSLError(socket.error): ...
|
||||
class SSLError(OSError): ...
|
||||
class SSLEOFError(SSLError): ...
|
||||
class SSLSyscallError(SSLError): ...
|
||||
class SSLWantReadError(SSLError): ...
|
||||
class SSLWantWriteError(SSLError): ...
|
||||
class SSLZeroReturnError(SSLError): ...
|
||||
|
||||
OPENSSL_VERSION = ... # type: str
|
||||
OPENSSL_VERSION_INFO = ... # type: Any
|
||||
OPENSSL_VERSION_NUMBER = ... # type: int
|
||||
|
||||
VERIFY_CRL_CHECK_CHAIN = ... # type: int
|
||||
VERIFY_CRL_CHECK_LEAF = ... # type: int
|
||||
VERIFY_DEFAULT = ... # type: int
|
||||
VERIFY_X509_STRICT = ... # type: int
|
||||
|
||||
ALERT_DESCRIPTION_ACCESS_DENIED = ... # type: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE = ... # type: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE = ... # type: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE = ... # type: int
|
||||
ALERT_DESCRIPTION_BAD_RECORD_MAC = ... # type: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED = ... # type: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_REVOKED = ... # type: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN = ... # type: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE = ... # type: int
|
||||
ALERT_DESCRIPTION_CLOSE_NOTIFY = ... # type: int
|
||||
ALERT_DESCRIPTION_DECODE_ERROR = ... # type: int
|
||||
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE = ... # type: int
|
||||
ALERT_DESCRIPTION_DECRYPT_ERROR = ... # type: int
|
||||
ALERT_DESCRIPTION_HANDSHAKE_FAILURE = ... # type: int
|
||||
ALERT_DESCRIPTION_ILLEGAL_PARAMETER = ... # type: int
|
||||
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY = ... # type: int
|
||||
ALERT_DESCRIPTION_INTERNAL_ERROR = ... # type: int
|
||||
ALERT_DESCRIPTION_NO_RENEGOTIATION = ... # type: int
|
||||
ALERT_DESCRIPTION_PROTOCOL_VERSION = ... # type: int
|
||||
ALERT_DESCRIPTION_RECORD_OVERFLOW = ... # type: int
|
||||
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE = ... # type: int
|
||||
ALERT_DESCRIPTION_UNKNOWN_CA = ... # type: int
|
||||
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY = ... # type: int
|
||||
ALERT_DESCRIPTION_UNRECOGNIZED_NAME = ... # type: int
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE = ... # type: int
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION = ... # type: int
|
||||
ALERT_DESCRIPTION_USER_CANCELLED = ... # type: int
|
||||
|
||||
OP_ALL = ... # type: int
|
||||
OP_CIPHER_SERVER_PREFERENCE = ... # type: int
|
||||
OP_NO_COMPRESSION = ... # type: int
|
||||
OP_NO_SSLv2 = ... # type: int
|
||||
OP_NO_SSLv3 = ... # type: int
|
||||
OP_NO_TLSv1 = ... # type: int
|
||||
OP_NO_TLSv1_1 = ... # type: int
|
||||
OP_NO_TLSv1_2 = ... # type: int
|
||||
OP_SINGLE_DH_USE = ... # type: int
|
||||
OP_SINGLE_ECDH_USE = ... # type: int
|
||||
|
||||
SSL_ERROR_EOF = ... # type: int
|
||||
SSL_ERROR_INVALID_ERROR_CODE = ... # type: int
|
||||
SSL_ERROR_SSL = ... # type: int
|
||||
SSL_ERROR_SYSCALL = ... # type: int
|
||||
SSL_ERROR_WANT_CONNECT = ... # type: int
|
||||
SSL_ERROR_WANT_READ = ... # type: int
|
||||
SSL_ERROR_WANT_WRITE = ... # type: int
|
||||
SSL_ERROR_WANT_X509_LOOKUP = ... # type: int
|
||||
SSL_ERROR_ZERO_RETURN = ... # type: int
|
||||
|
||||
CERT_NONE = ... # type: int
|
||||
CERT_OPTIONAL = ... # type: int
|
||||
CERT_REQUIRED = ... # type: int
|
||||
|
||||
PROTOCOL_SSLv23 = ... # type: int
|
||||
PROTOCOL_SSLv3 = ... # type: int
|
||||
PROTOCOL_TLSv1 = ... # type: int
|
||||
PROTOCOL_TLSv1_1 = ... # type: int
|
||||
PROTOCOL_TLSv1_2 = ... # type: int
|
||||
|
||||
HAS_ECDH = ... # type: bool
|
||||
HAS_NPN = ... # type: bool
|
||||
HAS_SNI = ... # type: bool
|
||||
|
||||
CHANNEL_BINDING_TYPES = ... # type: Any
|
||||
|
||||
class CertificateError(ValueError): ...
|
||||
|
||||
def match_hostname(cert, hostname): ...
|
||||
|
||||
DefaultVerifyPaths = namedtuple('DefaultVerifyPaths', 'cafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capath')
|
||||
|
||||
def get_default_verify_paths(): ...
|
||||
|
||||
class _ASN1Object:
|
||||
def __new__(cls, oid): ...
|
||||
@classmethod
|
||||
def fromnid(cls, nid): ...
|
||||
@classmethod
|
||||
def fromname(cls, name): ...
|
||||
|
||||
class Purpose(_ASN1Object):
|
||||
SERVER_AUTH = ... # type: Purpose
|
||||
CLIENT_AUTH = ... # type: Purpose
|
||||
|
||||
class _SSLContext:
|
||||
check_hostname = ... # type: Any
|
||||
options = ... # type: Any
|
||||
verify_flags = ... # type: Any
|
||||
verify_mode = ... # type: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def _set_npn_protocols(self, *args, **kwargs): ...
|
||||
def _wrap_socket(self, *args, **kwargs): ...
|
||||
def cert_store_stats(self): ...
|
||||
def get_ca_certs(self, binary_form=...): ...
|
||||
def load_cert_chain(self, *args, **kwargs): ...
|
||||
def load_dh_params(self, *args, **kwargs): ...
|
||||
def load_verify_locations(self, *args, **kwargs): ...
|
||||
def session_stats(self, *args, **kwargs): ...
|
||||
def set_ciphers(self, *args, **kwargs): ...
|
||||
def set_default_verify_paths(self, *args, **kwargs): ...
|
||||
def set_ecdh_curve(self, *args, **kwargs): ...
|
||||
def set_servername_callback(self, method): ...
|
||||
|
||||
class SSLContext(_SSLContext):
|
||||
def __new__(cls, protocol, *args, **kwargs): ...
|
||||
protocol = ... # type: Any
|
||||
def __init__(self, protocol): ...
|
||||
def wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname=None): ...
|
||||
def set_npn_protocols(self, npn_protocols): ...
|
||||
def set_alpn_protocols(self, alpn_protocols): ...
|
||||
def load_default_certs(self, purpose=...): ...
|
||||
|
||||
def create_default_context(purpose=..., cafile=None, capath=None, cadata=None): ...
|
||||
|
||||
class SSLSocket(socket):
|
||||
keyfile = ... # type: Any
|
||||
certfile = ... # type: Any
|
||||
cert_reqs = ... # type: Any
|
||||
ssl_version = ... # type: Any
|
||||
ca_certs = ... # type: Any
|
||||
ciphers = ... # type: Any
|
||||
server_side = ... # type: Any
|
||||
server_hostname = ... # type: Any
|
||||
do_handshake_on_connect = ... # type: Any
|
||||
suppress_ragged_eofs = ... # type: Any
|
||||
def __init__(self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=..., ssl_version=..., ca_certs=None, do_handshake_on_connect=True, family=..., type=..., proto=0, fileno=None, suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, server_hostname=None, _context=None): ...
|
||||
@property
|
||||
def context(self): ...
|
||||
@context.setter
|
||||
def context(self, ctx): ...
|
||||
def dup(self): ...
|
||||
def read(self, len=0, buffer=None): ...
|
||||
def write(self, data): ...
|
||||
def getpeercert(self, binary_form=False): ...
|
||||
def selected_npn_protocol(self): ...
|
||||
def selected_alpn_protocol(self): ...
|
||||
def cipher(self): ...
|
||||
def compression(self): ...
|
||||
def send(self, data, flags=0): ...
|
||||
def sendto(self, data, flags_or_addr, addr=None): ...
|
||||
def sendall(self, data, flags=0): ...
|
||||
def recv(self, buflen=1024, flags=0): ...
|
||||
def recv_into(self, buffer, nbytes=None, flags=0): ...
|
||||
def recvfrom(self, buflen=1024, flags=0): ...
|
||||
def recvfrom_into(self, buffer, nbytes=None, flags=0): ...
|
||||
def pending(self): ...
|
||||
def shutdown(self, how): ...
|
||||
def close(self): ...
|
||||
def unwrap(self): ...
|
||||
def do_handshake(self, block=False): ...
|
||||
def connect(self, addr): ...
|
||||
def connect_ex(self, addr): ...
|
||||
def accept(self): ...
|
||||
def makefile(self, mode='', bufsize=-1): ...
|
||||
def get_channel_binding(self, cb_type=''): ...
|
||||
def version(self): ...
|
||||
|
||||
def wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=..., ssl_version=..., ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None): ...
|
||||
def cert_time_to_seconds(cert_time): ...
|
||||
|
||||
PEM_HEADER = ... # type: Any
|
||||
PEM_FOOTER = ... # type: Any
|
||||
|
||||
def DER_cert_to_PEM_cert(der_cert_bytes): ...
|
||||
def PEM_cert_to_DER_cert(pem_cert_string): ...
|
||||
def get_server_certificate(addr, ssl_version=..., ca_certs=None): ...
|
||||
def get_protocol_name(protocol_code): ...
|
||||
def sslwrap_simple(sock, keyfile=None, certfile=None): ...
|
||||
|
||||
@@ -29,7 +29,7 @@ class CalledProcessError(Exception):
|
||||
cmd = ... # type: str
|
||||
output = ... # type: str # May be None
|
||||
|
||||
def __init__(self, returncode: int, cmd: str, output: str) -> None: ...
|
||||
def __init__(self, returncode: int, cmd: str, output: str = ...) -> None: ...
|
||||
|
||||
class Popen:
|
||||
stdin = ... # type: Optional[IO[Any]]
|
||||
|
||||
@@ -167,6 +167,7 @@ class Mapping(Sized, Iterable[_KT], Container[_KT], Generic[_KT, _VT]):
|
||||
def iterkeys(self) -> Iterator[_KT]: ...
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
|
||||
class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
@abstractmethod
|
||||
|
||||
66
stdlib/2.7/weakref.pyi
Normal file
66
stdlib/2.7/weakref.pyi
Normal file
@@ -0,0 +1,66 @@
|
||||
# Stubs for weakref (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
import UserDict
|
||||
from _weakref import getweakrefcount as getweakrefcount, getweakrefs as getweakrefs, ref as ref, proxy as proxy, CallableProxyType as CallableProxyType, ProxyType as ProxyType, ReferenceType as ReferenceType
|
||||
from _weakrefset import WeakSet as WeakSet
|
||||
from exceptions import ReferenceError as ReferenceError
|
||||
|
||||
ProxyTypes = ... # type: Any
|
||||
|
||||
class WeakValueDictionary(UserDict.UserDict):
|
||||
def __init__(self, *args, **kw): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __delitem__(self, key): ...
|
||||
def __contains__(self, key): ...
|
||||
def has_key(self, key): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def clear(self): ...
|
||||
def copy(self): ...
|
||||
__copy__ = ... # type: Any
|
||||
def __deepcopy__(self, memo): ...
|
||||
def get(self, key, default=None): ...
|
||||
def items(self): ...
|
||||
def iteritems(self): ...
|
||||
def iterkeys(self): ...
|
||||
__iter__ = ... # type: Any
|
||||
def itervaluerefs(self): ...
|
||||
def itervalues(self): ...
|
||||
def popitem(self): ...
|
||||
def pop(self, key, *args): ...
|
||||
def setdefault(self, key, default=None): ...
|
||||
def update(self, dict=None, **kwargs): ...
|
||||
def valuerefs(self): ...
|
||||
def values(self): ...
|
||||
|
||||
class KeyedRef(ReferenceType):
|
||||
key = ... # type: Any
|
||||
def __new__(type, ob, callback, key): ...
|
||||
def __init__(self, ob, callback, key): ...
|
||||
|
||||
class WeakKeyDictionary(UserDict.UserDict):
|
||||
data = ... # type: Any
|
||||
def __init__(self, dict=None): ...
|
||||
def __delitem__(self, key): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def copy(self): ...
|
||||
__copy__ = ... # type: Any
|
||||
def __deepcopy__(self, memo): ...
|
||||
def get(self, key, default=None): ...
|
||||
def has_key(self, key): ...
|
||||
def __contains__(self, key): ...
|
||||
def items(self): ...
|
||||
def iteritems(self): ...
|
||||
def iterkeyrefs(self): ...
|
||||
def iterkeys(self): ...
|
||||
__iter__ = ... # type: Any
|
||||
def itervalues(self): ...
|
||||
def keyrefs(self): ...
|
||||
def keys(self): ...
|
||||
def popitem(self): ...
|
||||
def pop(self, key, *args): ...
|
||||
def setdefault(self, key, default=None): ...
|
||||
def update(self, dict=None, **kwargs): ...
|
||||
0
stdlib/2.7/wsgiref/__init__.pyi
Normal file
0
stdlib/2.7/wsgiref/__init__.pyi
Normal file
47
stdlib/2.7/wsgiref/validate.pyi
Normal file
47
stdlib/2.7/wsgiref/validate.pyi
Normal file
@@ -0,0 +1,47 @@
|
||||
# Stubs for wsgiref.validate (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class WSGIWarning(Warning): ...
|
||||
|
||||
def validator(application): ...
|
||||
|
||||
class InputWrapper:
|
||||
input = ... # type: Any
|
||||
def __init__(self, wsgi_input): ...
|
||||
def read(self, *args): ...
|
||||
def readline(self): ...
|
||||
def readlines(self, *args): ...
|
||||
def __iter__(self): ...
|
||||
def close(self): ...
|
||||
|
||||
class ErrorWrapper:
|
||||
errors = ... # type: Any
|
||||
def __init__(self, wsgi_errors): ...
|
||||
def write(self, s): ...
|
||||
def flush(self): ...
|
||||
def writelines(self, seq): ...
|
||||
def close(self): ...
|
||||
|
||||
class WriteWrapper:
|
||||
writer = ... # type: Any
|
||||
def __init__(self, wsgi_writer): ...
|
||||
def __call__(self, s): ...
|
||||
|
||||
class PartialIteratorWrapper:
|
||||
iterator = ... # type: Any
|
||||
def __init__(self, wsgi_iterator): ...
|
||||
def __iter__(self): ...
|
||||
|
||||
class IteratorWrapper:
|
||||
original_iterator = ... # type: Any
|
||||
iterator = ... # type: Any
|
||||
closed = ... # type: Any
|
||||
check_start_response = ... # type: Any
|
||||
def __init__(self, wsgi_iterator, check_start_response): ...
|
||||
def __iter__(self): ...
|
||||
def next(self): ...
|
||||
def close(self): ...
|
||||
def __del__(self): ...
|
||||
Reference in New Issue
Block a user