Skip to content

Commit f505b74

Browse files
ShaharNavehjreback
authored andcommitted
TYP: Type annotations in pandas/io/formats/{html,printing}.py (#30404)
1 parent 050ba59 commit f505b74

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pandas/io/formats/html.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ def write_th(
109109
----------
110110
s : object
111111
The data to be written inside the cell.
112-
header : boolean, default False
112+
header : bool, default False
113113
Set to True if the <th> is for use inside <thead>. This will
114114
cause min-width to be set if there is one.
115115
indent : int, default 0
116116
The indentation level of the cell.
117-
tags : string, default None
117+
tags : str, default None
118118
Tags to include in the cell.
119119
120120
Returns

pandas/io/formats/printing.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
printing tools
2+
Printing tools.
33
"""
44

55
import sys
@@ -182,13 +182,12 @@ def pprint_thing(
182182
replacements
183183
default_escapes : bool, default False
184184
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
187187
188188
Returns
189189
-------
190190
str
191-
192191
"""
193192

194193
def as_escaped_string(
@@ -312,7 +311,6 @@ def format_object_summary(
312311
Returns
313312
-------
314313
summary string
315-
316314
"""
317315
from pandas.io.formats.console import get_console_size
318316
from pandas.io.formats.format import _get_adjustment
@@ -346,15 +344,17 @@ def format_object_summary(
346344
# adj can optionally handle unicode eastern asian width
347345
adj = _get_adjustment()
348346

349-
def _extend_line(s, line, value, display_width, next_line_prefix):
347+
def _extend_line(
348+
s: str, line: str, value: str, display_width: int, next_line_prefix: str
349+
) -> Tuple[str, str]:
350350

351351
if adj.len(line.rstrip()) + adj.len(value.rstrip()) >= display_width:
352352
s += line.rstrip()
353353
line = next_line_prefix
354354
line += value
355355
return s, line
356356

357-
def best_len(values):
357+
def best_len(values: List[str]) -> int:
358358
if values:
359359
return max(adj.len(x) for x in values)
360360
else:

0 commit comments

Comments
 (0)