ipython / ipython/traitlets

The behaviour of traitlets.All in observe/unobserve

Đang mở
#485 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
good first issue
Ngôn ngữ chính
Python
Star
653
Fork
217
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.