From 18a8d28ebef25286839bdebd722e7b8d04e5ca2c Mon Sep 17 00:00:00 2001 From: Rebecca Jean Herman Date: Tue, 20 Aug 2024 15:15:35 +0200 Subject: [PATCH] minor change to fix issue preventing passing in an interable for showindex --- tabulate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 11bb8655..6ce51a6a 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -1485,7 +1485,7 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"): # add or remove an index column showindex_is_a_str = type(showindex) in [str, bytes] - if showindex == "default" and index is not None: + if showindex_is_a_str and showindex == "default" and index is not None: rows = _prepend_row_index(rows, index) elif isinstance(showindex, Sized) and not showindex_is_a_str: rows = _prepend_row_index(rows, list(showindex))