From 1cb0cbf4b9f87e4eccd9d6cfd5b4340550677993 Mon Sep 17 00:00:00 2001 From: Gordon Ball Date: Thu, 3 Jul 2014 12:01:56 +0200 Subject: [PATCH] Remove 4-5 tuple forms from interact() --- IPython/html/widgets/interaction.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/IPython/html/widgets/interaction.py b/IPython/html/widgets/interaction.py index 113c2fe5e..1b59de88e 100644 --- a/IPython/html/widgets/interaction.py +++ b/IPython/html/widgets/interaction.py @@ -23,7 +23,7 @@ from inspect import getcallargs from IPython.core.getipython import get_ipython from IPython.html.widgets import (Widget, TextWidget, FloatSliderWidget, IntSliderWidget, CheckboxWidget, DropdownWidget, - ContainerWidget, DOMWidget, IntRangeSliderWidget, FloatRangeSliderWidget) + ContainerWidget, DOMWidget) from IPython.display import display, clear_output from IPython.utils.py3compat import string_types, unicode_type from IPython.utils.traitlets import HasTraits, Any, Unicode @@ -107,26 +107,6 @@ def _widget_abbrev(o): else: cls = FloatSliderWidget return cls(value=value, min=min, max=max, step=step) - elif _matches(o, [float_or_int]*4): - min, low, high, max = o - if not min <= low <= high <= max: - raise ValueError("Range input expects min <= low <= high <= max, got {0}".format(o)) - if all(isinstance(_, int) for _ in o): - cls = IntRangeSliderWidget - else: - cls = FloatRangeSliderWidget - return cls(value=(low, high), min=min, max=max) - elif _matches(o, [float_or_int]*5): - min, low, high, max, step = o - if not min <= low <= high <= max: - raise ValueError("Range input expects min <= low <= high <= max, got {0}".format(o)) - if step <= 0: - raise ValueError("step must be >= 0, not %r" % step) - if all(isinstance(_, int) for _ in o): - cls = IntRangeSliderWidget - else: - cls = FloatRangeSliderWidget - return cls(value=(low, high), min=min, max=max, step=step) else: return _widget_abbrev_single_value(o)