diff --git a/stubs/3.2/docutils/parsers/rst/__init__.pyi b/stubs/2.7/xml/__init__.pyi similarity index 100% rename from stubs/3.2/docutils/parsers/rst/__init__.pyi rename to stubs/2.7/xml/__init__.pyi diff --git a/stubs/2.7/xml/__init__.py b/stubs/2.7/xml/sax/__init__.pyi similarity index 100% rename from stubs/2.7/xml/__init__.py rename to stubs/2.7/xml/sax/__init__.pyi diff --git a/stubs/3.2/bisect.pyi b/stubs/3.2/bisect.pyi new file mode 100644 index 000000000000..e2e12b696465 --- /dev/null +++ b/stubs/3.2/bisect.pyi @@ -0,0 +1,12 @@ +from typing import Sequence, TypeVar + +_T = TypeVar('_T') + +def insort_left(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass +def insort_right(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass + +def bisect_left(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass +def bisect_right(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass + +insort = insort_right +bisect = bisect_right diff --git a/stubs/3.2/builtins.pyi b/stubs/3.2/builtins.pyi index df082f30169c..838d7209beaa 100644 --- a/stubs/3.2/builtins.pyi +++ b/stubs/3.2/builtins.pyi @@ -3,8 +3,8 @@ from typing import ( TypeVar, Iterator, Iterable, overload, Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, - Set, AbstractSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, - SupportsRound, IO, Union, ItemsView, KeysView, ValuesView, ByteString + Set, AbstractSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsBytes, + SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView, ValuesView, ByteString ) from abc import abstractmethod, ABCMeta @@ -255,6 +255,8 @@ class bytes(ByteString): def __init__(self, length: int) -> None: ... @overload def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... def capitalize(self) -> bytes: ... def center(self, width: int, fillchar: bytes = None) -> bytes: ... def count(self, x: bytes) -> int: ... diff --git a/stubs/3.2/cgi.pyi b/stubs/3.2/cgi.pyi index 8c622dfb7476..86d4eac1cf5a 100644 --- a/stubs/3.2/cgi.pyi +++ b/stubs/3.2/cgi.pyi @@ -1 +1 @@ -def escape(s: str) -> str: ... +def escape(s: str, quote: bool = False) -> str: ... diff --git a/stubs/3.2/codecs.pyi b/stubs/3.2/codecs.pyi index 0ad02b7e8d7a..c44713e71231 100644 --- a/stubs/3.2/codecs.pyi +++ b/stubs/3.2/codecs.pyi @@ -1,31 +1,194 @@ -from typing import Any, BinaryIO, Callable, IO +# Better codecs stubs hand-written by o11c. +# https://docs.python.org/3/library/codecs.html +from typing import ( + BinaryIO, + Callable, + Iterable, + Iterator, + List, + Tuple, + Union, +) -BOM_UTF8 = b'' +from abc import abstractmethod + + +# TODO: this only satisfies the most common interface, where +# bytes is the raw form and str is the cooked form. +# In the long run, both should become template parameters maybe? +# There *are* bytes->bytes and str->str encodings in the standard library. +# Python 3.5 supposedly might change something there. + +_decoded = str +_encoded = bytes + +# TODO: It is not possible to specify these signatures correctly, because +# they have an optional positional or keyword argument for errors=. +_encode_type = Callable[[_decoded], _encoded] # signature of Codec().encode +_decode_type = Callable[[_encoded], _decoded] # signature of Codec().decode +_stream_reader_type = Callable[[BinaryIO], 'StreamReader'] # signature of StreamReader __init__ +_stream_writer_type = Callable[[BinaryIO], 'StreamWriter'] # signature of StreamWriter __init__ +_incremental_encoder_type = Callable[[], 'IncrementalEncoder'] # signature of IncrementalEncoder __init__ +_incremental_decode_type = Callable[[], 'IncrementalDecoder'] # signature of IncrementalDecoder __init__ -class Codec: ... -class StreamWriter(Codec): ... -class CodecInfo(tuple): - def __init__(self, *args) -> None: ... +def encode(obj: _decoded, encoding: str = 'utf-8', errors: str = 'strict') -> _encoded: + ... +def decode(obj: _encoded, encoding: str = 'utf-8', errors: str = 'strict') -> _decoded: + ... + +def lookup(encoding: str) -> 'CodecInfo': + ... +class CodecInfo(Tuple[_encode_type, _decode_type, _stream_reader_type, _stream_writer_type]): + def __init__(self, encode: _encode_type, decode: _decode_type, streamreader: _stream_reader_type = None, streamwriter: _stream_writer_type = None, incrementalencoder: _incremental_encoder_type = None, incrementaldecoder: _incremental_decode_type = None, name: str = None) -> None: + self.encode = encode + self.decode = decode + self.streamreader = streamreader + self.streamwriter = streamwriter + self.incrementalencoder = incrementalencoder + self.incrementaldecoder = incrementaldecoder + self.name = name + +def getencoder(encoding: str) -> _encode_type: + ... +def getdecoder(encoding: str) -> _encode_type: + ... +def getincrementalencoder(encoding: str) -> _incremental_encoder_type: + ... +def getincrementaldecoder(encoding: str) -> _incremental_encoder_type: + ... +def getreader(encoding: str) -> _stream_reader_type: + ... +def getwriter(encoding: str) -> _stream_writer_type: + ... def register(search_function: Callable[[str], CodecInfo]) -> None: ... -def register_error(name: str, error_handler: Callable[[UnicodeError], Any]) -> None: ... +def open(filename: str, mode: str = 'r', encoding: str = None, errors: str = 'strict', buffering: int = 1) -> StreamReaderWriter: + ... -def lookup(encoding: str) -> CodecInfo: +def EncodedFile(file: BinaryIO, data_encoding: str, file_encoding: str = None, errors = 'strict') -> 'StreamRecoder': ... -# TODO This Callable is actually a StreamWriter constructor -def getwriter(encoding: str) -> Callable[[BinaryIO], StreamWriter]: ... +def iterencode(iterator: Iterable[_decoded], encoding: str, errors: str = 'strict') -> Iterator[_encoded]: + ... +def iterdecode(iterator: Iterable[_encoded], encoding: str, errors: str = 'strict') -> Iterator[_decoded]: + ... -class IncrementalDecoder: - errors = ... # type: Any - def __init__(self, errors=''): ... - def decode(self, input, final=False): ... - def reset(self): ... - def getstate(self): ... - def setstate(self, state): ... +BOM = b'' +BOM_BE = b'' +BOM_LE = b'' +BOM_UTF8 = b'' +BOM_UTF16 = b'' +BOM_UTF16_BE = b'' +BOM_UTF16_LE = b'' +BOM_UTF32 = b'' +BOM_UTF32_BE = b'' +BOM_UTF32_LE = b'' + +# It is expected that different actions be taken depending on which of the +# three subclasses of `UnicodeError` is actually ...ed. However, the Union +# is still needed for at least one of the cases. +def register_error(name: str, error_handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: + ... +def lookup_error(name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: + ... -def open(filename: str, mode: str='rb', encoding: str=None, errors: str='strict', buffering: int=1) -> IO[Any]: +def strict_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: + ... +def replace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: + ... +def ignore_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: + ... +def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: + ... +def backslashreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... + +class Codec: + # These are sort of @abstractmethod but sort of not. + # The StreamReader and StreamWriter subclasses only implement one. + def encode(self, input: _decoded, errors: str = 'strict') -> Tuple[_encoded, int]: + ... + def decode(self, input: _encoded, errors: str = 'strict') -> Tuple[_decoded, int]: + ... + +class IncrementalEncoder: + def __init__(self, errors: str = 'strict') -> None: + self.errors = errors + @abstractmethod + def encode(self, object: _decoded, final: bool = False) -> _encoded: + ... + def reset(self) -> None: + ... + # documentation says int but str is needed for the subclass. + def getstate(self) -> Union[int, _decoded]: + ... + def setstate(self, state: Union[int, _decoded]) -> None: + ... + +class IncrementalDecoder: + def __init__(self, errors: str = 'strict') -> None: + self.errors = errors + @abstractmethod + def decode(self, object: _encoded, final: bool = False) -> _decoded: + ... + def reset(self) -> None: + ... + def getstate(self) -> Tuple[_encoded, int]: + ... + def setstate(self, state: Tuple[_encoded, int]) -> None: + ... + +# These are not documented but used in encodings/*.py implementations. +class BufferedIncrementalEncoder(IncrementalEncoder): + def __init__(self, errors: str = 'strict') -> None: + IncrementalEncoder.__init__(self, errors) + self.buffer = '' + @abstractmethod + def _buffer_encode(self, input: _decoded, errors: str, final: bool) -> _encoded: + ... + def encode(self, input: _decoded, final: bool = False) -> _encoded: + ... +class BufferedIncrementalDecoder(IncrementalDecoder): + def __init__(self, errors: str = 'strict') -> None: + IncrementalDecoder.__init__(self, errors) + self.buffer = b'' + @abstractmethod + def _buffer_decode(self, input: _encoded, errors: str, final: bool) -> Tuple[_decoded, int]: + ... + def decode(self, object: _encoded, final: bool = False) -> _decoded: + ... + +# TODO: it is not possible to specify the requirement that all other +# attributes and methods are passed-through from the stream. +class StreamWriter(Codec): + def __init__(self, stream: BinaryIO, errors: str = 'strict') -> None: + self.errors = errors + def write(self, obj: _decoded) -> None: + ... + def writelines(self, list: List[str]) -> None: + ... + def reset(self) -> None: + ... + +class StreamReader(Codec): + def __init__(self, stream: BinaryIO, errors: str = 'strict') -> None: + self.errors = errors + def read(self, size: int = -1, chars: int = -1, firstline: bool = False) -> _decoded: + ... + def readline(self, size: int = -1, keepends: bool = True) -> _decoded: + ... + def readlines(self, sizehint: int = -1, keepends: bool = True) -> List[_decoded]: + ... + def reset(self) -> None: + ... + +class StreamReaderWriter: + def __init__(self, stream: BinaryIO, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = 'strict') -> None: + ... + +class StreamRecoder(BinaryIO): + def __init__(self, stream: BinaryIO, encode: _encode_type, decode: _decode_type, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = 'strict') -> None: + ... diff --git a/stubs/3.2/encodings.pyi b/stubs/3.2/encodings/__init__.pyi similarity index 100% rename from stubs/3.2/encodings.pyi rename to stubs/3.2/encodings/__init__.pyi diff --git a/stubs/3.2/encodings/utf_8.pyi b/stubs/3.2/encodings/utf_8.pyi new file mode 100644 index 000000000000..b10865428d50 --- /dev/null +++ b/stubs/3.2/encodings/utf_8.pyi @@ -0,0 +1,14 @@ +import codecs + +class IncrementalEncoder(codecs.IncrementalEncoder): + pass +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + pass +class StreamWriter(codecs.StreamWriter): + pass +class StreamReader(codecs.StreamReader): + pass + +def getregentry() -> codecs.CodecInfo: pass +def encode(input: str, errors: str = 'strict') -> bytes: pass +def decode(input: bytes, errors: str = 'strict') -> str: pass diff --git a/stubs/3.2/inspect.pyi b/stubs/3.2/inspect.pyi index d4fae4b71d6b..9286aa04f83a 100644 --- a/stubs/3.2/inspect.pyi +++ b/stubs/3.2/inspect.pyi @@ -1,6 +1,7 @@ # Stubs for inspect from typing import Any, Tuple, List, Callable +from types import FrameType _object = object @@ -29,3 +30,5 @@ class ArgSpec(tuple): defaults = ... # type: tuple def getargspec(func: object) -> ArgSpec: ... + +def stack() -> List[Tuple[FrameType, str, int, str, List[str], int]]: ... diff --git a/stubs/3.2/os/__init__.pyi b/stubs/3.2/os/__init__.pyi index 3ada3551f118..b6113bb34dc3 100644 --- a/stubs/3.2/os/__init__.pyi +++ b/stubs/3.2/os/__init__.pyi @@ -5,7 +5,7 @@ from typing import ( Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr, - Optional, Generic + Optional, Generic, Set ) from builtins import OSError as error import os.path as path @@ -336,3 +336,11 @@ def confstr(name: str) -> str: ... # Unix only def getloadavg() -> Tuple[float, float, float]: ... # Unix only def sysconf(name: str) -> int: ... # Unix only def urandom(n: int) -> bytes: ... + +def sched_getaffinity(id: int) -> Set[int]: ... +class waitresult: + si_pid = 0 +def waitid(idtype: int, id: int, options: int) -> waitresult: ... +P_ALL = 0 +WEXITED = 0 +WNOWAIT = 0 diff --git a/stubs/3.2/pipes.pyi b/stubs/3.2/pipes.pyi new file mode 100644 index 000000000000..62163d622cca --- /dev/null +++ b/stubs/3.2/pipes.pyi @@ -0,0 +1,19 @@ +# Stubs for pipes + +# Based on http://docs.python.org/3.5/library/pipes.html + +import os + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> 'Template': ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, rw: str) -> os.popen: ... + def copy(self, file: str, rw: str) -> os.popen: ... + +# Not documented, but widely used. +# Documented as shlex.quote since 3.3. +def quote(s: str) -> str: ... diff --git a/stubs/3.2/shlex.pyi b/stubs/3.2/shlex.pyi index 8d6e01c27187..431d20a8e59b 100644 --- a/stubs/3.2/shlex.pyi +++ b/stubs/3.2/shlex.pyi @@ -7,6 +7,9 @@ from typing import List, Tuple, Any, TextIO def split(s: str, comments: bool = False, posix: bool = True) -> List[str]: ... +# Added in 3.3, use (undocumented) pipes.quote in previous versions. +def quote(s: str) -> str: ... + class shlex: commenters = '' wordchars = '' diff --git a/stubs/3.2/sys.pyi b/stubs/3.2/sys.pyi index 210216bd3ebc..fe769e50b4f6 100644 --- a/stubs/3.2/sys.pyi +++ b/stubs/3.2/sys.pyi @@ -4,7 +4,7 @@ # based on http://docs.python.org/3.2/library/sys.html from typing import ( - List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional + List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union ) from types import TracebackType @@ -115,7 +115,7 @@ def displayhook(value: Optional[int]) -> None: ... def excepthook(type_: type, value: BaseException, traceback: TracebackType) -> None: ... def exc_info() -> Tuple[type, BaseException, TracebackType]: ... -def exit(arg: int = None) -> None: ... +def exit(arg: Union[int, str] = None) -> None: ... def getcheckinterval() -> int: ... # deprecated def getdefaultencoding() -> str: ... def getdlopenflags() -> int: ... # Unix only diff --git a/stubs/3.2/textwrap.pyi b/stubs/3.2/textwrap.pyi new file mode 100644 index 000000000000..e02f020eb548 --- /dev/null +++ b/stubs/3.2/textwrap.pyi @@ -0,0 +1,118 @@ +# Better textwrap stubs hand-written by o11c. +# https://docs.python.org/3/library/textwrap.html +from typing import ( + Callable, + List, +) + +class TextWrapper: + def __init__(self, + width: int = 70, + *, + initial_indent: str = '', + subsequent_indent: str = '', + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + max_lines: int = None, + placeholder: str = ' [...]', + ) -> None: + self.width = width + self.initial_indent = initial_indent + self.subsequent_indent = subsequent_indent + self.expand_tabs = expand_tabs + self.tabsize = tabsize + self.replace_whitespace = replace_whitespace + self.fix_sentence_endings = fix_sentence_endings + self.break_long_words = break_long_words + self.break_on_hyphens = break_on_hyphens + self.drop_whitespace = drop_whitespace + self.max_lines = max_lines + self.placeholder = placeholder + + # Private methods *are* part of the documented API for subclasses. + def _munge_whitespace(self, text: str) -> str: + ... + + def _split(self, text: str) -> List[str]: + ... + + def _fix_sentence_endings(self, chunks: List[str]) -> None: + ... + + def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None: + ... + + def _wrap_chunks(self, chunks: List[str]) -> List[str]: + ... + + def _split_chunks(self, text: str) -> List[str]: + ... + + def wrap(self, text: str) -> List[str]: + ... + + def fill(self, text: str) -> str: + ... + + +def wrap( + width: int = 70, + *, + initial_indent: str = '', + subsequent_indent: str = '', + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + max_lines: int = None, + placeholder: str = ' [...]', +) -> List[str]: + ... + +def fill( + width: int = 70, + *, + initial_indent: str = '', + subsequent_indent: str = '', + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + max_lines: int = None, + placeholder: str = ' [...]', +): + ... + +def shorten( + width: int, + *, + initial_indent: str = '', + subsequent_indent: str = '', + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + # Omit `max_lines: int = None`, it is forced to 1 here. + placeholder: str = ' [...]', +): + ... + +def dedent(text: str) -> str: + ... + +def indent(text: str, prefix: str, predicate: Callable[[str], bool] = None) -> str: + ... diff --git a/stubs/3.2/token.pyi b/stubs/3.2/token.pyi new file mode 100644 index 000000000000..76a746f1753c --- /dev/null +++ b/stubs/3.2/token.pyi @@ -0,0 +1,63 @@ +from typing import Dict + +ENDMARKER = 0 +NAME = 0 +NUMBER = 0 +STRING = 0 +NEWLINE = 0 +INDENT = 0 +DEDENT = 0 +LPAR = 0 +RPAR = 0 +LSQB = 0 +RSQB = 0 +COLON = 0 +COMMA = 0 +SEMI = 0 +PLUS = 0 +MINUS = 0 +STAR = 0 +SLASH = 0 +VBAR = 0 +AMPER = 0 +LESS = 0 +GREATER = 0 +EQUAL = 0 +DOT = 0 +PERCENT = 0 +LBRACE = 0 +RBRACE = 0 +EQEQUAL = 0 +NOTEQUAL = 0 +LESSEQUAL = 0 +GREATEREQUAL = 0 +TILDE = 0 +CIRCUMFLEX = 0 +LEFTSHIFT = 0 +RIGHTSHIFT = 0 +DOUBLESTAR = 0 +PLUSEQUAL = 0 +MINEQUAL = 0 +STAREQUAL = 0 +SLASHEQUAL = 0 +PERCENTEQUAL = 0 +AMPEREQUAL = 0 +VBAREQUAL = 0 +CIRCUMFLEXEQUAL = 0 +LEFTSHIFTEQUAL = 0 +RIGHTSHIFTEQUAL = 0 +DOUBLESTAREQUAL = 0 +DOUBLESLASH = 0 +DOUBLESLASHEQUAL = 0 +AT = 0 +RARROW = 0 +ELLIPSIS = 0 +OP = 0 +ERRORTOKEN = 0 +N_TOKENS = 0 +NT_OFFSET = 0 +tok_name = {} # type: Dict[int, str] + +def ISTERMINAL(x: int) -> bool: pass +def ISNONTERMINAL(x: int) -> bool: pass +def ISEOF(x: int) -> bool: pass diff --git a/stubs/3.2/types.pyi b/stubs/3.2/types.pyi index 866f05d44970..80f4ac02c386 100644 --- a/stubs/3.2/types.pyi +++ b/stubs/3.2/types.pyi @@ -2,7 +2,7 @@ # TODO this is work in progress -from typing import Any +from typing import Any, Callable, Dict, Sequence class ModuleType: __name__ = ... # type: str @@ -12,8 +12,55 @@ class ModuleType: class MethodType: ... class BuiltinMethodType: ... +class CodeType: + """Create a code object. Not for the faint of heart.""" + def __init__(self, + argcount: int, + kwonlyargcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: bytes, + constants: Sequence[Any], + names: Sequence[str], + varnames: Sequence[str], + filename: str, + name: str, + firstlineno: int, + lnotab: bytes, + freevars: Sequence[str] = (), + cellvars: Sequence[str] = (), + ) -> None: + self.co_argcount = argcount + self.co_kwonlyargcount = kwonlyargcount + self.co_nlocals = nlocals + self.co_stacksize = stacksize + self.co_flags = flags + self.co_code = codestring + self.co_consts = constants + self.co_names = names + self.co_varnames = varnames + self.co_filename = filename + self.co_name = name + self.co_firstlineno = firstlineno + self.co_lnotab = lnotab + self.co_freevars = freevars + self.co_cellvars = cellvars + +class FrameType: + f_back = ... # type: FrameType + f_builtins = ... # type: Dict[str, Any] + f_code = ... # type: CodeType + f_globals = ... # type: Dict[str, Any] + f_lasti = ... # type: int + f_lineno = ... # type: int + f_locals = ... # type: Dict[str, Any] + f_trace = ... # type: Callable[[], None] + + def clear(self) -> None: pass + class TracebackType: - tb_frame = ... # type: Any + tb_frame = ... # type: FrameType tb_lasti = ... # type: int tb_lineno = ... # type: int - tb_next = ... # type: Any + tb_next = ... # type: TracebackType diff --git a/stubs/3.2/typing.pyi b/stubs/3.2/typing.pyi index 89fac9284aa0..c6d50b79bdc4 100644 --- a/stubs/3.2/typing.pyi +++ b/stubs/3.2/typing.pyi @@ -56,6 +56,14 @@ class SupportsFloat(metaclass=ABCMeta): @abstractmethod def __float__(self) -> float: ... +class SupportsComplex(metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: pass + +class SupportsBytes(metaclass=ABCMeta): + @abstractmethod + def __bytes__(self) -> bytes: pass + class SupportsAbs(Generic[_T]): @abstractmethod def __abs__(self) -> _T: ... diff --git a/stubs/3.3/ipaddress.pyi b/stubs/3.3/ipaddress.pyi index 21696493150c..19ba2c20e765 100644 --- a/stubs/3.3/ipaddress.pyi +++ b/stubs/3.3/ipaddress.pyi @@ -194,7 +194,6 @@ class IPv6Interface(IPv6Address): class IPv6Network(_BaseV6, _BaseNetwork): network_address = ... # type: Any netmask = ... # type: Any - hosts = ... # type: Any def __init__(self, address, strict=True): ... def hosts(self): ... @property diff --git a/stubs/2.7/xml/sax/__init__.py b/stubs/third-party-2.7/Crypto/__init__.pyi similarity index 100% rename from stubs/2.7/xml/sax/__init__.py rename to stubs/third-party-2.7/Crypto/__init__.pyi diff --git a/stubs/3.2/docutils/__init__.pyi b/stubs/third-party-3.2/docutils/__init__.pyi similarity index 100% rename from stubs/3.2/docutils/__init__.pyi rename to stubs/third-party-3.2/docutils/__init__.pyi diff --git a/stubs/3.2/docutils/examples.pyi b/stubs/third-party-3.2/docutils/examples.pyi similarity index 100% rename from stubs/3.2/docutils/examples.pyi rename to stubs/third-party-3.2/docutils/examples.pyi diff --git a/stubs/3.2/docutils/nodes.pyi b/stubs/third-party-3.2/docutils/nodes.pyi similarity index 100% rename from stubs/3.2/docutils/nodes.pyi rename to stubs/third-party-3.2/docutils/nodes.pyi diff --git a/stubs/3.2/docutils/parsers/__init__.pyi b/stubs/third-party-3.2/docutils/parsers/__init__.pyi similarity index 100% rename from stubs/3.2/docutils/parsers/__init__.pyi rename to stubs/third-party-3.2/docutils/parsers/__init__.pyi diff --git a/stubs/third-party-2.7/Crypto/__init__.py b/stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/__init__.py rename to stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi diff --git a/stubs/3.2/docutils/parsers/rst/nodes.pyi b/stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi similarity index 100% rename from stubs/3.2/docutils/parsers/rst/nodes.pyi rename to stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi diff --git a/stubs/3.2/docutils/parsers/rst/roles.pyi b/stubs/third-party-3.2/docutils/parsers/rst/roles.pyi similarity index 100% rename from stubs/3.2/docutils/parsers/rst/roles.pyi rename to stubs/third-party-3.2/docutils/parsers/rst/roles.pyi diff --git a/stubs/3.2/docutils/parsers/rst/states.pyi b/stubs/third-party-3.2/docutils/parsers/rst/states.pyi similarity index 100% rename from stubs/3.2/docutils/parsers/rst/states.pyi rename to stubs/third-party-3.2/docutils/parsers/rst/states.pyi