ipython / ipython/traitlets

Add support for firing one-time events when observing

未关闭
#691 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
653
派生
217
平均合并
2 天 21 小时
30 天内合并 PR
2

描述

I have a frequent pattern that comes up time and again with my jupyter widgets (depends on traitlets) and think it would be helpful to have this supported in the API:
```
append_type_radio.observe(toggle_append_type, names='value');
toggle_append_type({'new': toggle_append_radio.value}) # call it once to initialize
```

^-- the above is a hack and I would much prefer a way to have a signal automatically come when subscribing (i.e. eager execution)
or, optionally, a way to manually trigger an event, so that anything that depends on initial state can get updated.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。