1 from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict
\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
11 if sys.version_info >= (3, 4):
\r
12 from opcode import stack_effect as stack_effect
\r
14 if sys.version_info >= (3, 6):
\r
15 from opcode import hasnargs as hasnargs
\r
17 _have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type]
\r
18 _have_code_or_string = Union[_have_code, str, bytes]
\r
21 if sys.version_info >= (3, 4):
\r
22 Instruction = NamedTuple(
\r
27 ('arg', Optional[int]),
\r
31 ('starts_line', Optional[int]),
\r
32 ('is_jump_target', bool)
\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
47 def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ...
\r
50 COMPILER_FLAG_NAMES = ... # type: Dict[int, str]
\r
53 def findlabels(code: _have_code) -> List[int]: ...
\r
54 def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
\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
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
67 def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ...
\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
74 if sys.version_info >= (3, 0):
\r
75 def show_code(co: _have_code) -> None: ...
\r