diff --git a/seaborn/_base.py b/seaborn/_base.py index 9e1961e6e5..28f25dd91b 100644 --- a/seaborn/_base.py +++ b/seaborn/_base.py @@ -933,10 +933,8 @@ def iter_data( grouping_keys = [] for var in grouping_vars: - if key := levels.get(var): - grouping_keys.append(key) - else: - grouping_keys.append([]) + key = levels.get(var) if levels.get(var) is not None else [] + grouping_keys.append(key) iter_keys = itertools.product(*grouping_keys) if reverse: