From feab63754d4ac00afcc1bbf8332f52d9d6c02c8d Mon Sep 17 00:00:00 2001 From: MinRK Date: Mon, 3 Feb 2014 16:43:35 -0800 Subject: [PATCH] update interact now that SelectionWidget.values is a dict --- IPython/html/widgets/interaction.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IPython/html/widgets/interaction.py b/IPython/html/widgets/interaction.py index daec5ad21..0fca34c0d 100644 --- a/IPython/html/widgets/interaction.py +++ b/IPython/html/widgets/interaction.py @@ -67,10 +67,9 @@ def _widget_abbrev_single_value(o): if isinstance(o, string_types): return TextWidget(value=unicode_type(o)) elif isinstance(o, dict): - labels = [unicode_type(k) for k in o] - values = o.values() - w = DropdownWidget(value=values[0], values=values, labels=labels) - return w + # get a single value in a Python 2+3 way: + value = next(iter(o.values())) + return DropdownWidget(value=value, values=o) elif isinstance(o, bool): return CheckboxWidget(value=o) elif isinstance(o, float):