Skip to content

Commit 55a93ee

Browse files
author
MomIsBestFriend
committed
TYP: Type annotations in pandas/io/formats/{html,printing}.py
1 parent a2bbdb5 commit 55a93ee

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
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-8
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,15 +182,13 @@ 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
"""
193-
194192
def as_escaped_string(
195193
thing: Any, escape_chars: Optional[EscapeChars] = escape_chars
196194
) -> str:
@@ -312,7 +310,6 @@ def format_object_summary(
312310
Returns
313311
-------
314312
summary string
315-
316313
"""
317314
from pandas.io.formats.console import get_console_size
318315
from pandas.io.formats.format import _get_adjustment
@@ -346,15 +343,17 @@ def format_object_summary(
346343
# adj can optionally handle unicode eastern asian width
347344
adj = _get_adjustment()
348345

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:
350349

351350
if adj.len(line.rstrip()) + adj.len(value.rstrip()) >= display_width:
352351
s += line.rstrip()
353352
line = next_line_prefix
354353
line += value
355354
return s, line
356355

357-
def best_len(values):
356+
def best_len(values: List[Any]) -> int:
358357
if values:
359358
return max(adj.len(x) for x in values)
360359
else:

0 commit comments

Comments
 (0)