@@ -169,13 +169,13 @@ def _html_row_with_attrs(celltag, unsafe, cell_values, colwidths, colaligns):
169169 }
170170 if unsafe :
171171 values_with_attrs = [
172- "<{0}{1}>{2}</{0}>" .format (celltag , alignment .get (a , "" ), c ) for c ,
173- a in zip (cell_values , colaligns )
172+ "<{0}{1}>{2}</{0}>" .format (celltag , alignment .get (a , "" ), c )
173+ for c , a in zip (cell_values , colaligns )
174174 ]
175175 else :
176176 values_with_attrs = [
177- "<{0}{1}>{2}</{0}>" .format (celltag , alignment .get (a , "" ), htmlescape (c )) for c ,
178- a in zip (cell_values , colaligns )
177+ "<{0}{1}>{2}</{0}>" .format (celltag , alignment .get (a , "" ), htmlescape (c ))
178+ for c , a in zip (cell_values , colaligns )
179179 ]
180180 rowhtml = "<tr>{}</tr>" .format ("" .join (values_with_attrs ).rstrip ())
181181 if celltag == "th" : # it's a header row, create a new table header
@@ -191,8 +191,8 @@ def _moin_row_with_attrs(celltag, cell_values, colwidths, colaligns, header=""):
191191 "decimal" : '<style="text-align: right;">' ,
192192 }
193193 values_with_attrs = [
194- "{}{} {} " .format (celltag , alignment .get (a , "" ), header + c + header ) for c ,
195- a in zip (cell_values , colaligns )
194+ "{}{} {} " .format (celltag , alignment .get (a , "" ), header + c + header )
195+ for c , a in zip (cell_values , colaligns )
196196 ]
197197 return "" .join (values_with_attrs ) + "||"
198198
@@ -1162,8 +1162,9 @@ def _align_column(
11621162 # wcswidth and _visible_width don't count invisible characters;
11631163 # padfn doesn't need to apply another correction
11641164 padded_strings = [
1165- "\n " .join ([padfn (w , s ) for s , w in zip ((ms .splitlines () or ms ), mw )]) for ms ,
1166- mw in zip (strings , visible_widths )
1165+ "\n " .join ([padfn (w , s )
1166+ for s , w in zip ((ms .splitlines () or ms ), mw )])
1167+ for ms , mw in zip (strings , visible_widths )
11671168 ]
11681169 else : # single-line cell values
11691170 if not enable_widechars and not has_invisible :
@@ -2163,11 +2164,9 @@ def tabulate(
21632164 missing_vals = list (missingval )
21642165 if len (missing_vals ) < len (cols ):
21652166 missing_vals .extend ((len (cols ) - len (missing_vals )) * [_DEFAULT_MISSINGVAL ])
2166- cols = [[_format (v , ct , fl_fmt , int_fmt , miss_v , has_invisible ) for v in c ] for c ,
2167- ct ,
2168- fl_fmt ,
2169- int_fmt ,
2170- miss_v in zip (cols , coltypes , float_formats , int_formats , missing_vals )]
2167+ cols = [[_format (v , ct , fl_fmt , int_fmt , miss_v ,
2168+ has_invisible ) for v in c ] for c , ct , fl_fmt , int_fmt , miss_v in zip (
2169+ cols , coltypes , float_formats , int_formats , missing_vals )]
21712170
21722171 # align columns
21732172 # first set global alignment
@@ -2189,9 +2188,8 @@ def tabulate(
21892188 aligns [idx ] = align
21902189 minwidths = ([width_fn (h ) + min_padding for h in headers ] if headers else [0 ] * len (cols ))
21912190 cols = [
2192- _align_column (c , a , minw , has_invisible , enable_widechars , is_multiline ) for c ,
2193- a ,
2194- minw in zip (cols , aligns , minwidths )
2191+ _align_column (c , a , minw , has_invisible , enable_widechars , is_multiline )
2192+ for c , a , minw in zip (cols , aligns , minwidths )
21952193 ]
21962194
21972195 aligns_headers = None
@@ -2220,9 +2218,8 @@ def tabulate(
22202218 aligns_headers [hidx ] = align
22212219 minwidths = [max (minw , max (width_fn (cl ) for cl in c )) for minw , c in zip (minwidths , t_cols )]
22222220 headers = [
2223- _align_header (h , a , minw , width_fn (h ), is_multiline , width_fn ) for h ,
2224- a ,
2225- minw in zip (headers , aligns_headers , minwidths )
2221+ _align_header (h , a , minw , width_fn (h ), is_multiline , width_fn )
2222+ for h , a , minw in zip (headers , aligns_headers , minwidths )
22262223 ]
22272224 rows = list (zip (* cols ))
22282225 else :
0 commit comments