The behaviour of traitlets.All in observe/unobserve
- 主要语言
- Python
- 星标
- 653
- 派生
- 217
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 2
描述
I'm finding the behaviour of `traits.All` very confusing in `observe` and `unobserve`. Since I can't find much documentation on it, I thought I'd ask here.
My confusion started when I was using observe and unobserve over at ipywidgets. I created jupyter-widgets/ipywidgets#2057 as I thought it was an ipywidgets issue.
That issue is more descriptive (and will clarify this issue for anyone confused), but in short: I expected `.unobserve(names=traitlets.All)` to unobserve _all_ traits for a given function. Instead, I find that I need to specify the same name as I did when I called `.observe()`.
This is of course fine, but then I don't understand the point of `All`, or why it is listed in the docstring as a default argument.
To sum things up: I am confused by the behaviour and purpose of traitlets.All, and by the docstring of observe and unobserve.
To add: I am very impressed by traitlets in general, and I'm really excited to see what more I can use it for - I've already enjoyed using it very much.
贡献指南
调研方向
Start with the observe and unobserve docstrings and the linked ipywidgets issue to understand the reported behavior of traitlets.All. Document the purpose and behavior of All, including how it applies when observing versus unobserving traits, so the defaults and examples are unambiguous.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100