Refactor and group change handler data into an object
- Dominant language
- Python
- Stars
- 462
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
In the notifiers for observers, we have these pieces of information:
https://github.com/enthought/traits/blob/4145b41912fc6df99b99f33da2f7cac436336b72/traits/observers/_trait_event_notifier.py#L44-L57
https://github.com/enthought/traits/blob/4145b41912fc6df99b99f33da2f7cac436336b72/traits/observers/_trait_event_notifier.py#L69-L72
The `handler`, `target` and `dispatcher` are defined by the user at the time when `observe` is called (`observe` being the future replacement of `on_trait_change`). In other words, they don't change throughout the lifetime of the "observe" action and only the user has a say in what they should be.
They can therefore be grouped together, making it easy for them to be passed around and compared.
This refactoring will not affect the user facing API.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.