Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions stdlib/3/dis.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import (List, Union, Iterator, Iterable, Tuple, Optional, Dict,
Any, IO, NamedTuple)
from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple

from opcode import (hasconst, hasname, hasjrel, hasjabs, haslocal, hascompare,
hasfree, hasnargs, cmp_op, opname , opmap , HAVE_ARGUMENT,
Expand All @@ -11,7 +10,7 @@ _have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type]
_have_code_or_string = Union[_have_code, str, bytes]


class Instruction(NamedTuple("Instruction", [
Instruction = NamedTuple("Instruction", [
('opname', str),
('opcode', int),
('arg', Optional[int]),
Expand All @@ -20,18 +19,7 @@ class Instruction(NamedTuple("Instruction", [
('offset', int),
('starts_line', Optional[int]),
('is_jump_target', bool)
])):
# ad-hoc - seems to be an error in the NamedTuple type hint
# TODO: mypy issue #1076
_fields = ... # type: List[str]
_source = ... # type: str
def _replace(self, *, opname: str = ..., opcode: int = ...,
arg: Optional[int] = ..., argval: Any = ..., argrepr: str = ...,
offset: int = ..., starts_line: Optional[int] = ...,
is_jump_target: bool = ...) -> Instruction: ...
def _asdict(self) -> Dict[str, Any]: ...
@staticmethod
def _make(iterable: Iterable[Any]) -> Instruction: ...
])


# if sys.version_info >= (3, 4):
Expand Down