|
1 | 1 | """
|
2 |
| -printing tools |
| 2 | +Printing tools. |
3 | 3 | """
|
4 | 4 |
|
5 | 5 | import sys
|
@@ -182,15 +182,13 @@ def pprint_thing(
|
182 | 182 | replacements
|
183 | 183 | default_escapes : bool, default False
|
184 | 184 | Whether the input escape characters replaces or adds to the defaults
|
185 |
| - max_seq_items : False, int, default None |
186 |
| - Pass thru to other pretty printers to limit sequence printing |
| 185 | + max_seq_items : int or None, default None |
| 186 | + Pass through to other pretty printers to limit sequence printing |
187 | 187 |
|
188 | 188 | Returns
|
189 | 189 | -------
|
190 | 190 | str
|
191 |
| -
|
192 | 191 | """
|
193 |
| - |
194 | 192 | def as_escaped_string(
|
195 | 193 | thing: Any, escape_chars: Optional[EscapeChars] = escape_chars
|
196 | 194 | ) -> str:
|
@@ -312,7 +310,6 @@ def format_object_summary(
|
312 | 310 | Returns
|
313 | 311 | -------
|
314 | 312 | summary string
|
315 |
| -
|
316 | 313 | """
|
317 | 314 | from pandas.io.formats.console import get_console_size
|
318 | 315 | from pandas.io.formats.format import _get_adjustment
|
@@ -346,15 +343,17 @@ def format_object_summary(
|
346 | 343 | # adj can optionally handle unicode eastern asian width
|
347 | 344 | adj = _get_adjustment()
|
348 | 345 |
|
349 |
| - def _extend_line(s, line, value, display_width, next_line_prefix): |
| 346 | + def _extend_line( |
| 347 | + s, line: str, value: str, display_width: int, next_line_prefix: str |
| 348 | + ) -> Tuple: |
350 | 349 |
|
351 | 350 | if adj.len(line.rstrip()) + adj.len(value.rstrip()) >= display_width:
|
352 | 351 | s += line.rstrip()
|
353 | 352 | line = next_line_prefix
|
354 | 353 | line += value
|
355 | 354 | return s, line
|
356 | 355 |
|
357 |
| - def best_len(values): |
| 356 | + def best_len(values: List[Any]) -> int: |
358 | 357 | if values:
|
359 | 358 | return max(adj.len(x) for x in values)
|
360 | 359 | else:
|
|
0 commit comments