Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.7 stub updates #149

Merged
merged 9 commits into from
Apr 18, 2016
44 changes: 44 additions & 0 deletions stdlib/2.7/Cookie.pyi
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion stdlib/2.7/__future__.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 9 additions & 4 deletions stdlib/2.7/_weakref.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
from typing import Any, Callable
from typing import Any, Callable, Generic, Optional, TypeVar

_T = TypeVar('_T')

class CallableProxyType(object): # "weakcallableproxy"
pass

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: ...
Expand Down
44 changes: 44 additions & 0 deletions stdlib/2.7/email/_parseaddr.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions stdlib/2.7/email/utils.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions stdlib/2.7/genericpath.pyi
Original file line number Diff line number Diff line change
@@ -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): ...
4 changes: 3 additions & 1 deletion stdlib/2.7/hmac.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Expand All @@ -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 changes: 7 additions & 0 deletions stdlib/2.7/linecache.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 33 additions & 0 deletions stdlib/2.7/locale.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions stdlib/2.7/mimetypes.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 32 additions & 0 deletions stdlib/2.7/multiprocessing/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 39 additions & 0 deletions stdlib/2.7/multiprocessing/process.pyi
Original file line number Diff line number Diff line change
@@ -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 changes: 33 additions & 0 deletions stdlib/2.7/multiprocessing/util.pyi
Original file line number Diff line number Diff line change
@@ -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): ...
Loading