ipython / ipython/traitlets

Possible move of comparison to a separate function inside set

Đang mở
#277 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
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ả

``` python
try:
silent = bool(old_value == new_value)
except:
# if there is an error in comparing, default to notify
silent = False
```

When `==` doesn't work (think `np.array` or `pd.DataFrame`), this is equivalent to failing silently in some sense. We should move this section to a separate compare function that can be overload by a `TraitType` so the entire logic of `set` doesn't need to be copied.

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.