You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use observe inherited from traitlets.HasTraits which uses names=traitlets.All as a default argument. This can have confusing effects for anyone who wants to manually observe a widget. For example see #3192
My sense is that for most of the core widgets people really only want to observe the value trait so it's a bit unnecessary to always have to do slider.observe(callback, names='value') or to add an if statement to the callback.
Proposed Solution
Override observe for the widget classes to give a default argument for names that is curated for the widget being used. So for example for an IntSlider we would change the default to be value.
Marking as 8.0 due to back incompat.
The text was updated successfully, but these errors were encountered:
In our dev meeting today, we discussed this and think that probably it would be too big of a change? Do you have a nice elegant solution we could look at?
Problem
We use
observe
inherited fromtraitlets.HasTraits
which usesnames=traitlets.All
as a default argument. This can have confusing effects for anyone who wants to manually observe a widget. For example see #3192My sense is that for most of the core widgets people really only want to observe the
value
trait so it's a bit unnecessary to always have to doslider.observe(callback, names='value')
or to add anif
statement to the callback.Proposed Solution
Override
observe
for the widget classes to give a default argument for names that is curated for the widget being used. So for example for anIntSlider
we would change the default to bevalue
.Marking as
8.0
due to back incompat.The text was updated successfully, but these errors were encountered: