@@ -961,18 +961,17 @@ def _type(string, has_invisible=True, numparse=True):
961961 elif _isbool (string ):
962962 return bool
963963 elif numparse and (
964- _isint (string ) or (
964+ _isint (string )
965+ or (
965966 isinstance (string , str )
966967 and _isnumber_with_thousands_separator (string )
967- and '.' not in string
968+ and "." not in string
968969 )
969970 ):
970971 return int
971972 elif numparse and (
972- _isnumber (string ) or (
973- isinstance (string , str )
974- and _isnumber_with_thousands_separator (string )
975- )
973+ _isnumber (string )
974+ or (isinstance (string , str ) and _isnumber_with_thousands_separator (string ))
976975 ):
977976 return float
978977 elif isinstance (string , bytes ):
@@ -1316,8 +1315,8 @@ def _format(val, valtype, floatfmt, intfmt, missingval="", has_invisible=True):
13161315 formatted_val = format (float (raw_val ), floatfmt )
13171316 return val .replace (raw_val , formatted_val )
13181317 else :
1319- if isinstance (val ,str ) and ',' in val :
1320- val = val .replace (',' , '' ) # handle thousands-separators
1318+ if isinstance (val , str ) and "," in val :
1319+ val = val .replace ("," , "" ) # handle thousands-separators
13211320 return format (float (val ), floatfmt )
13221321 else :
13231322 return f"{ val } "
@@ -2584,7 +2583,12 @@ def _format_table(
25842583 for row , ralign in zip (rows [:- 1 ], rowaligns ):
25852584 if row != SEPARATING_LINE :
25862585 append_row (
2587- lines , pad_row (row , pad ), padded_widths , colaligns , fmt .datarow , rowalign = ralign
2586+ lines ,
2587+ pad_row (row , pad ),
2588+ padded_widths ,
2589+ colaligns ,
2590+ fmt .datarow ,
2591+ rowalign = ralign ,
25882592 )
25892593 _append_line (lines , padded_widths , colaligns , fmt .linebetweenrows )
25902594 # the last row without a line below
@@ -2610,7 +2614,9 @@ def _format_table(
26102614 if _is_separating_line (row ):
26112615 _append_line (lines , padded_widths , colaligns , separating_line )
26122616 else :
2613- append_row (lines , pad_row (row , pad ), padded_widths , colaligns , fmt .datarow )
2617+ append_row (
2618+ lines , pad_row (row , pad ), padded_widths , colaligns , fmt .datarow
2619+ )
26142620
26152621 if fmt .linebelow and "linebelow" not in hidden :
26162622 _append_line (lines , padded_widths , colaligns , fmt .linebelow )
@@ -2705,11 +2711,14 @@ def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
27052711 if _ansi_codes .search (chunk ) is not None :
27062712 for group , _ , _ , _ in _ansi_codes .findall (chunk ):
27072713 escape_len = len (group )
2708- if group in chunk [last_group : i + total_escape_len + escape_len - 1 ]:
2714+ if (
2715+ group
2716+ in chunk [last_group : i + total_escape_len + escape_len - 1 ]
2717+ ):
27092718 total_escape_len += escape_len
27102719 found = _ansi_codes .search (chunk [last_group :])
27112720 last_group += found .end ()
2712- cur_line .append (chunk [: i + total_escape_len - 1 ])
2721+ cur_line .append (chunk [: i + total_escape_len - 1 ])
27132722 reversed_chunks [- 1 ] = chunk [i + total_escape_len - 1 :]
27142723
27152724 # Otherwise, we have to preserve the long word intact. Only add
0 commit comments