get_grouped_opcodes() returns an iterable of groups, not an iterable of opcodes. (#2183)

The type signature of get_grouped_opcodes() was incorrect. Resulting in type errors when checking return values.

The usage of this function is like this:
groups = sm.get_grouped_opcodes() # groups is Iterable[List[Tuple[str, int, int, int, int]]]
for group in groups:  #  group is List[Tuple[str, int, int, int, int]]
  for opcode in group:  # opcode is Tuple[str, int, int, int, int]
This commit is contained in:
Stephen Thorne
2018-06-01 17:59:57 +01:00
committed by Jelle Zijlstra
parent b7ee95aa56
commit a25ff0bddf

View File

@@ -34,7 +34,7 @@ class SequenceMatcher(Generic[_T]):
def get_matching_blocks(self) -> List[Match]: ...
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...
) -> Iterable[Tuple[str, int, int, int, int]]: ...
) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...