[IPython-dev] Default values for widgets

Brian Granger ellisonbg at gmail.com
Sat Feb 8 17:20:32 EST 2014

Thinking a bit more...

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 think it is a bit dangerous to do 3. It would probably be a better
solution to use 3 for setting the initial value of the widget.
Otherwise, I think we are making defaults for functions do too many
things. Stefan, want to open an issue on this? If others like it, you
could even to a PR ;-) It shouldn't be too difficult.



On Fri, Feb 7, 2014 at 11:08 PM, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> On Fri, 07 Feb 2014 22:56:36 -0800, Brian Granger wrote:
>> interact(f, a=FloatSliderWidget(..., value=10), ...)
> That will do the trick for me, thanks.
>> We decided that we wanted to keep the abbreviations as simple as
>> possible and just allow people to pass Widgets for the more
>> complicated usage cases. Part of this is that we are wanting to be as
>> slow/conservative as possible in introducing complexity to new APIs.
>> We want to see how this stuff works in practice and gather data from
>> our users (like this!).
> The data point for me then is that it feels unintuitive that the default
> keyword argument is not respected.
> Thanks for all your hard work on this!
> Stéfan
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com

More information about the IPython-dev mailing list