Merge branch 'master' into threading

Conflicts:
	stdlib/3/threading.pyi
This commit is contained in:
Daniel Shaulov
2016-01-23 10:34:30 +00:00
21 changed files with 228 additions and 34 deletions

View File

@@ -191,12 +191,12 @@ class unicode(basestring, Sequence[unicode]):
@overload
def __init__(self, o: object) -> None: ...
@overload
def __init__(self, o: str, encoding: unicode = ..., errors: unicode = 'strict') -> None: ...
def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ...
def capitalize(self) -> unicode: ...
def center(self, width: int, fillchar: unicode = u' ') -> unicode: ...
def count(self, x: unicode) -> int: ...
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> unicode: ...
def encode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ...
def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = 0,
end: int = ...) -> bool: ...
def expandtabs(self, tabsize: int = 8) -> unicode: ...
@@ -267,8 +267,8 @@ class str(basestring, Sequence[str]):
def capitalize(self) -> str: ...
def center(self, width: int, fillchar: str = ...) -> str: ...
def count(self, x: unicode) -> int: ...
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> unicode: ...
def encode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ...
def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]]) -> bool: ...
def expandtabs(self, tabsize: int = 8) -> str: ...
def find(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
@@ -359,13 +359,13 @@ class bytearray(Sequence[int]):
def __init__(self, x: Union[Iterable[int], str]) -> None: ...
@overload
def __init__(self, x: unicode, encoding: unicode,
errors: unicode = 'strict') -> None: ...
errors: unicode = ...) -> None: ...
@overload
def __init__(self, length: int) -> None: ...
def capitalize(self) -> bytearray: ...
def center(self, width: int, fillchar: str = ...) -> bytearray: ...
def count(self, x: str) -> int: ...
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
def endswith(self, suffix: Union[str, Tuple[str, ...]]) -> bool: ...
def expandtabs(self, tabsize: int = 8) -> bytearray: ...
def find(self, sub: str, start: int = 0, end: int = ...) -> int: ...

View File

@@ -61,7 +61,7 @@ class excel_tab(excel):
class unix_dialect(Dialect):
pass
class DictReader:
class DictReader(Iterable):
restkey = ... # type: Any
restval = ... # type: Any
reader = ... # type: Any

9
stdlib/2.7/doctest.pyi Normal file
View File

@@ -0,0 +1,9 @@
# Stubs for doctest
# NOTE: These are incomplete!
from typing import Any, Tuple
# TODO arguments missing
def testmod(m: Any = ..., name: str = ..., globs: Any = ...,
verbose: bool = ...) -> Tuple[int, int]: ...

View File

@@ -1,5 +1,5 @@
# TODO incomplete
from typing import Any, List, Tuple
from typing import Any, List, Tuple, NamedTuple
def isgenerator(object: Any) -> bool: ...
@@ -9,3 +9,11 @@ _FrameRecord = Tuple[_Frame, str, int, str, List[str], int]
def currentframe() -> _FrameRecord: ...
def stack(context: int = ...) -> List[_FrameRecord]: ...
ArgSpec = NamedTuple('ArgSpec', [('args', List[str]),
('varargs', str),
('keywords', str),
('defaults', tuple),
])
def getargspec(func: object) -> ArgSpec: ...

45
stdlib/2.7/platform.pyi Normal file
View File

@@ -0,0 +1,45 @@
# Stubs for platform (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
__copyright__ = ... # type: Any
DEV_NULL = ... # type: Any
def libc_ver(executable=..., lib='', version='', chunksize=2048): ...
def linux_distribution(distname='', version='', id='', supported_dists=..., full_distribution_name=1): ...
def dist(distname='', version='', id='', supported_dists=...): ...
class _popen:
tmpfile = ... # type: Any
pipe = ... # type: Any
bufsize = ... # type: Any
mode = ... # type: Any
def __init__(self, cmd, mode='', bufsize=None): ...
def read(self): ...
def readlines(self): ...
def close(self, remove=..., error=...): ...
__del__ = ... # type: Any
def popen(cmd, mode='', bufsize=None): ...
def win32_ver(release='', version='', csd='', ptype=''): ...
def mac_ver(release='', versioninfo=..., machine=''): ...
def java_ver(release='', vendor='', vminfo=..., osinfo=...): ...
def system_alias(system, release, version): ...
def architecture(executable=..., bits='', linkage=''): ...
def uname(): ...
def system(): ...
def node(): ...
def release(): ...
def version(): ...
def machine(): ...
def processor(): ...
def python_implementation(): ...
def python_version(): ...
def python_version_tuple(): ...
def python_branch(): ...
def python_revision(): ...
def python_build(): ...
def python_compiler(): ...
def platform(aliased=0, terse=0): ...

View File

@@ -23,14 +23,14 @@ def crc32(data: str, value: int = ...) -> int: ...
def decompress(data: str, wbits: int = ..., bufsize: int = ...) -> str: ...
class compressobj:
def __init__(level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ...,
def __init__(self, level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ...,
strategy: int = ...) -> None: ...
def copy(self) -> "compressobj": ...
def compress(self, data: str) -> str: ...
def flush(self) -> None: ...
class decompressobj:
def __init__(wbits: int = ...) -> None: ...
def __init__(self, wbits: int = ...) -> None: ...
def copy(self) -> "decompressobj": ...
def decompress(self, data: str) -> str: ...
def decompress(self, data: str, max_length: int = ...) -> str: ...
def flush(self) -> None: ...