From 17be26165d6b6d4c5d4f1cc2076a41a7f382b074 Mon Sep 17 00:00:00 2001 From: jkleint Date: Wed, 15 Mar 2017 22:25:20 -0700 Subject: [PATCH] Relax type of TestCase.assertCountEqual() params from Sequence to Iterable (#1006) The stubs for `unittest.TestCase.assertCountEqual()` specify the parameters are Sequences; in fact the method works fine with Iterables, as the first thing the method does is convert them to lists. [1] The docs do say sequences, but it appears there is no reason they cannot be Iterables. [1]: https://github.com/python/cpython/blob/master/Lib/unittest/case.py#L1156 --- stdlib/3/unittest/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/unittest/__init__.pyi b/stdlib/3/unittest/__init__.pyi index 15ebff6bf..0755fc4c0 100644 --- a/stdlib/3/unittest/__init__.pyi +++ b/stdlib/3/unittest/__init__.pyi @@ -117,7 +117,7 @@ class TestCase: msg: Any = ...) -> None: ... def assertNotRegex(self, text: str, regex: Union[str, Pattern[str]], msg: Any = ...) -> None: ... - def assertCountEqual(self, first: Sequence[Any], second: Sequence[Any], + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = ...) -> None: ... def addTypeEqualityFunc(self, typeobj: Type[Any], function: Callable[..., None]) -> None: ...