massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / third_party / 3 / six / __init__.pyi
1 # Stubs for six (Python 3.5)\r
2 \r
3 from __future__ import print_function\r
4 \r
5 from typing import (\r
6     Any,\r
7     AnyStr,\r
8     Callable,\r
9     Dict,\r
10     ItemsView,\r
11     Iterable,\r
12     KeysView,\r
13     Mapping,\r
14     NoReturn,\r
15     Optional,\r
16     Pattern,\r
17     Tuple,\r
18     Type,\r
19     TypeVar,\r
20     Union,\r
21     ValuesView,\r
22     overload,\r
23 )\r
24 import types\r
25 import typing\r
26 import unittest\r
27 \r
28 # Exports\r
29 from io import StringIO as StringIO, BytesIO as BytesIO\r
30 from builtins import next as next\r
31 from functools import wraps as wraps\r
32 from . import moves\r
33 \r
34 _T = TypeVar('_T')\r
35 _K = TypeVar('_K')\r
36 _V = TypeVar('_V')\r
37 \r
38 # TODO make constant, then move this stub to 2and3\r
39 # https://github.com/python/typeshed/issues/17\r
40 PY2 = False\r
41 PY3 = True\r
42 PY34 = ...  # type: bool\r
43 \r
44 string_types = str,\r
45 integer_types = int,\r
46 class_types = type,\r
47 text_type = str\r
48 binary_type = bytes\r
49 \r
50 MAXSIZE = ...  # type: int\r
51 \r
52 # def add_move\r
53 # def remove_move\r
54 \r
55 def callable(obj: object) -> bool: ...\r
56 \r
57 def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ...\r
58 def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ...\r
59 def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ...\r
60 \r
61 Iterator = object\r
62 \r
63 def get_method_function(meth: types.MethodType) -> types.FunctionType: ...\r
64 def get_method_self(meth: types.MethodType) -> Optional[object]: ...\r
65 def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ...\r
66 def get_function_code(fun: types.FunctionType) -> types.CodeType: ...\r
67 def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ...\r
68 def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ...\r
69 \r
70 def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ...\r
71 def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ...\r
72 def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ...\r
73 # def iterlists\r
74 \r
75 def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ...\r
76 def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ...\r
77 def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ...\r
78 \r
79 def b(s: str) -> binary_type: ...\r
80 def u(s: str) -> text_type: ...\r
81 \r
82 unichr = chr\r
83 def int2byte(i: int) -> bytes: ...\r
84 def byte2int(bs: binary_type) -> int: ...\r
85 def indexbytes(buf: binary_type, i: int) -> int: ...\r
86 def iterbytes(buf: binary_type) -> typing.Iterator[int]: ...\r
87 \r
88 def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ...\r
89 @overload\r
90 def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ...\r
91 @overload\r
92 def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ...\r
93 def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...) -> None: ...\r
94 \r
95 exec_ = exec\r
96 \r
97 def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...) -> NoReturn: ...\r
98 def raise_from(value: BaseException, from_value: Optional[BaseException]) -> NoReturn: ...\r
99 \r
100 print_ = print\r
101 \r
102 def with_metaclass(meta: type, *bases: type) -> type: ...\r
103 def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ...\r
104 def python_2_unicode_compatible(klass: _T) -> _T: ...\r