From 3437dc194062e1f59d4f2b109ff49d167d203f53 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Wed, 7 Sep 2022 20:54:41 -0400 Subject: [PATCH 1/2] TYP: remove mypy ignores from io/formats/printing.py --- pandas/io/formats/printing.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pandas/io/formats/printing.py b/pandas/io/formats/printing.py index 77431533e703a..9e4c0a7aafb90 100644 --- a/pandas/io/formats/printing.py +++ b/pandas/io/formats/printing.py @@ -497,11 +497,7 @@ def _justify( tail = [ tuple(x.rjust(max_len) for x, max_len in zip(seq, max_length)) for seq in tail ] - # https://github.com/python/mypy/issues/4975 - # error: Incompatible return value type (got "Tuple[List[Sequence[str]], - # List[Sequence[str]]]", expected "Tuple[List[Tuple[str, ...]], - # List[Tuple[str, ...]]]") - return head, tail # type: ignore[return-value] + return head, tail class PrettyDict(Dict[_KT, _VT]): From a1e302a63206d99d1bf1ee3e52ac41328a22d890 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Thu, 8 Sep 2022 19:54:42 -0400 Subject: [PATCH 2/2] fixup! TYP: remove mypy ignores from io/formats/printing.py --- pandas/io/formats/printing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/io/formats/printing.py b/pandas/io/formats/printing.py index 9e4c0a7aafb90..1753cdf86a282 100644 --- a/pandas/io/formats/printing.py +++ b/pandas/io/formats/printing.py @@ -491,13 +491,13 @@ def _justify( max_length = [max(x, y) for x, y in zip(max_length, length)] # justify each item in each list-like in head and tail using max_length - head = [ + head_tuples = [ tuple(x.rjust(max_len) for x, max_len in zip(seq, max_length)) for seq in head ] - tail = [ + tail_tuples = [ tuple(x.rjust(max_len) for x, max_len in zip(seq, max_length)) for seq in tail ] - return head, tail + return head_tuples, tail_tuples class PrettyDict(Dict[_KT, _VT]):