From a48499c136513723b58fa62df4156ad030bc14a5 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 5 Mar 2026 10:28:42 +0100 Subject: [PATCH] Use `is` to compare types This is consistent with other similar checks in the code base. --- tabulate/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 249b3ff..5e766bf 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -126,13 +126,11 @@ def _is_separating_line_value(value): def _is_separating_line(row): row_type = type(row) - is_sl = (row_type == list or row_type == str) and ( + return (row_type is list or row_type is str) and ( (len(row) >= 1 and _is_separating_line_value(row[0])) or (len(row) >= 2 and _is_separating_line_value(row[1])) ) - return is_sl - def _pipe_segment_with_colons(align, colwidth): """Return a segment of a horizontal line with optional colons which