Description
tabulate(...) raises TypeError when rowalign (or maxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers, colalign, floatfmt, maxcolwidths, ...) accepts a tuple.
Reproduction
from tabulate import tabulate
tabulate([[1, 2], [3, 4]], rowalign=("top", "bottom"))
# TypeError: can only concatenate tuple (not "list") to tuple
tabulate([[1, 2], [3, 4]], rowalign=["top", "bottom"]) # works
Root cause
The internal sequence-padding helper does original + [default] * (num_desired - len(original)). When original is a tuple this is tuple + list, which raises (and it raises even when no padding is needed, since tuple + [] still fails). Coercing with list(original) first fixes it and matches how the other parameters behave.
Description
tabulate(...)raisesTypeErrorwhenrowalign(ormaxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers,colalign,floatfmt,maxcolwidths, ...) accepts a tuple.Reproduction
Root cause
The internal sequence-padding helper does
original + [default] * (num_desired - len(original)). Whenoriginalis a tuple this istuple + list, which raises (and it raises even when no padding is needed, sincetuple + []still fails). Coercing withlist(original)first fixes it and matches how the other parameters behave.