From a25ff0bddf4f1546bdb2e0ca54566fcedba0707e Mon Sep 17 00:00:00 2001 From: Stephen Thorne Date: Fri, 1 Jun 2018 17:59:57 +0100 Subject: [PATCH] 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] --- stdlib/2and3/difflib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/difflib.pyi b/stdlib/2and3/difflib.pyi index a2c3955b4..f948fe5f0 100644 --- a/stdlib/2and3/difflib.pyi +++ b/stdlib/2and3/difflib.pyi @@ -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: ...