massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / dis.pyi
1 from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict\r
2 \r
3 import sys\r
4 import types\r
5 \r
6 from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel,\r
7                     hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare,\r
8                     hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap,\r
9                     HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG)\r
10 \r
11 if sys.version_info >= (3, 4):\r
12     from opcode import stack_effect as stack_effect\r
13 \r
14 if sys.version_info >= (3, 6):\r
15     from opcode import hasnargs as hasnargs\r
16 \r
17 _have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type]\r
18 _have_code_or_string = Union[_have_code, str, bytes]\r
19 \r
20 \r
21 if sys.version_info >= (3, 4):\r
22     Instruction = NamedTuple(\r
23         "Instruction",\r
24         [\r
25             ('opname', str),\r
26             ('opcode', int),\r
27             ('arg', Optional[int]),\r
28             ('argval', Any),\r
29             ('argrepr', str),\r
30             ('offset', int),\r
31             ('starts_line', Optional[int]),\r
32             ('is_jump_target', bool)\r
33         ]\r
34     )\r
35 \r
36     class Bytecode:\r
37         codeobj = ...  # type: types.CodeType\r
38         first_line = ...  # type: int\r
39         def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ...,\r
40                      current_offset: Optional[int] = ...) -> None: ...\r
41         def __iter__(self) -> Iterator[Instruction]: ...\r
42         def __repr__(self) -> str: ...\r
43         def info(self) -> str: ...\r
44         def dis(self) -> str: ...\r
45 \r
46         @classmethod\r
47         def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ...\r
48 \r
49 \r
50 COMPILER_FLAG_NAMES = ...  # type:  Dict[int, str]\r
51 \r
52 \r
53 def findlabels(code: _have_code) -> List[int]: ...\r
54 def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...\r
55 \r
56 if sys.version_info >= (3, 0):\r
57     def pretty_flags(flags: int) -> str: ...\r
58     def code_info(x: _have_code_or_string) -> str: ...\r
59 \r
60 if sys.version_info >= (3, 4):\r
61     def dis(x: _have_code_or_string = ..., *, file: Optional[IO[str]] = ...) -> None: ...\r
62     def distb(tb: Optional[types.TracebackType] = ..., *, file: Optional[IO[str]] = ...) -> None: ...\r
63     def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ...\r
64     def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ...\r
65     def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ...\r
66 \r
67     def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ...\r
68 else:\r
69     def dis(x: _have_code_or_string = ...) -> None: ...\r
70     def distb(tb: types.TracebackType = ...) -> None: ...\r
71     def disassemble(co: _have_code, lasti: int = ...) -> None: ...\r
72     def disco(co: _have_code, lasti: int = ...) -> None: ...\r
73 \r
74     if sys.version_info >= (3, 0):\r
75         def show_code(co: _have_code) -> None: ...\r