enthought / enthought/chaco

Remove thing_changed Event traits if possible

Open
#604 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
305
Forks
97
PR merge metrics
No merged PRs in 30d

Description

**Problem Description**
I personally find it very confusing to have a trait named `thing_changed = Event` which explicitly gets set to `True` when `thing` changes. Chaco will often listen to that trait when setting up change handlers, but I am not seeing why we couldn't just listen to the trait itself. e.g why do something like `observe(_____, thing_changed)` instead of just `observe(_____, thing)`.
I may be missing something important as to why this is needed but as far as I can tell it is not.

See #601 which removed the `metadata_changed` event trait. Other examples include:
https://github.com/enthought/chaco/blob/ef7227706642f7d26042717ad9b60648d7572068/chaco/base_2d_plot.py#L63-L76
https://github.com/enthought/chaco/blob/ef7227706642f7d26042717ad9b60648d7572068/chaco/base_2d_plot.py#L278-L284
https://github.com/enthought/chaco/blob/ef7227706642f7d26042717ad9b60648d7572068/chaco/base_2d_plot.py#L313-L332

In any case, if there is a reason that something like this needs to be done, we should still make an effort to clean this code up and make it more easily understandable / better documented of why things are like this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.