@@ -296,7 +296,7 @@ def make_header_line(is_header, colwidths, colaligns):
296296 else :
297297 raise ValueError (
298298 " _asciidoc_row() requires two (colwidths, colaligns) "
299- + "or three (cell_values, colwidths, colaligns) arguments) "
299+ "or three (cell_values, colwidths, colaligns) arguments) "
300300 )
301301
302302
@@ -1412,7 +1412,7 @@ def _prepend_row_index(rows, index):
14121412 if isinstance (index , Sized ) and len (index ) != len (rows ):
14131413 raise ValueError (
14141414 "index must be as long as the number of data rows: "
1415- + f"len(index)={ len (index )} len(rows)={ len (rows )} "
1415+ f"len(index)={ len (index )} len(rows)={ len (rows )} "
14161416 )
14171417 sans_rows , separating_lines = _remove_separating_lines (rows )
14181418 new_rows = []
@@ -1588,9 +1588,11 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):
15881588 if headers == "keys" :
15891589 headers = field_names
15901590 rows = [
1591- [getattr (row , f ) for f in field_names ]
1592- if not _is_separating_line (row )
1593- else row
1591+ (
1592+ [getattr (row , f ) for f in field_names ]
1593+ if not _is_separating_line (row )
1594+ else row
1595+ )
15941596 for row in rows
15951597 ]
15961598
@@ -1638,7 +1640,13 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):
16381640 return rows , headers , headers_pad
16391641
16401642
1641- def _wrap_text_to_colwidths (list_of_lists , colwidths , numparses = True , break_long_words = _BREAK_LONG_WORDS , break_on_hyphens = _BREAK_ON_HYPHENS ):
1643+ def _wrap_text_to_colwidths (
1644+ list_of_lists ,
1645+ colwidths ,
1646+ numparses = True ,
1647+ break_long_words = _BREAK_LONG_WORDS ,
1648+ break_on_hyphens = _BREAK_ON_HYPHENS ,
1649+ ):
16421650 if len (list_of_lists ):
16431651 num_cols = len (list_of_lists [0 ])
16441652 else :
@@ -1655,7 +1663,11 @@ def _wrap_text_to_colwidths(list_of_lists, colwidths, numparses=True, break_long
16551663 continue
16561664
16571665 if width is not None :
1658- wrapper = _CustomTextWrap (width = width , break_long_words = break_long_words , break_on_hyphens = break_on_hyphens )
1666+ wrapper = _CustomTextWrap (
1667+ width = width ,
1668+ break_long_words = break_long_words ,
1669+ break_on_hyphens = break_on_hyphens ,
1670+ )
16591671 casted_cell = str (cell )
16601672 wrapped = [
16611673 "\n " .join (wrapper .wrap (line ))
@@ -2258,7 +2270,11 @@ def tabulate(
22582270
22592271 numparses = _expand_numparse (disable_numparse , num_cols )
22602272 list_of_lists = _wrap_text_to_colwidths (
2261- list_of_lists , maxcolwidths , numparses = numparses , break_long_words = break_long_words , break_on_hyphens = break_on_hyphens
2273+ list_of_lists ,
2274+ maxcolwidths ,
2275+ numparses = numparses ,
2276+ break_long_words = break_long_words ,
2277+ break_on_hyphens = break_on_hyphens ,
22622278 )
22632279
22642280 if maxheadercolwidths is not None :
@@ -2272,7 +2288,11 @@ def tabulate(
22722288
22732289 numparses = _expand_numparse (disable_numparse , num_cols )
22742290 headers = _wrap_text_to_colwidths (
2275- [headers ], maxheadercolwidths , numparses = numparses , break_long_words = break_long_words , break_on_hyphens = break_on_hyphens
2291+ [headers ],
2292+ maxheadercolwidths ,
2293+ numparses = numparses ,
2294+ break_long_words = break_long_words ,
2295+ break_on_hyphens = break_on_hyphens ,
22762296 )[0 ]
22772297
22782298 # empty values in the first column of RST tables should be escaped (issue #82)
0 commit comments