[IPython-dev] Default values for widgets
Sat Feb 8 16:56:40 CST 2014
has two branches where it tests for:
elif default is not empty:
Just remove those. Then you would need to add logic *after* the
actual widgets that does something like:
widget.value = default
To set the value to the default. The only difficulty is for something
like a slider widget with finite step sizes, we would have to think
about what to do if the value wasn't at a valid step:
(0, 100, 10) with a default of 33
We could just allow it , or we could raise a ValueError.
On Sat, Feb 8, 2014 at 2:47 PM, Stéfan van der Walt <firstname.lastname@example.org> wrote:
> On Sat, 08 Feb 2014 14:20:32 -0800, Brian Granger wrote:
>> Right now, we look at the following places for widget abbreviations:
>> 1. kwargs to interact
>> 2. annotations
>> 3. defaults to individual keyword args in the def of the function.
> I can certainly add a PR to set the default widget value from the keyword.
> Another question: how do you prevent a keyword argument from being turned into
> a widget? Currently all arguments are processed, irrespective of whether they
> are specified in "interactive".
> IPython-dev mailing list
Brian E. Granger
Cal Poly State University, San Luis Obispo
email@example.com and firstname.lastname@example.org
More information about the IPython-dev