traits icon indicating copy to clipboard operation
traits copied to clipboard

Comparison mode on (cached) Property is not used for filtering change events

Open kitchoi opened this issue 4 years ago • 0 comments

When change events are fired for a normal trait type, the event goes through a filtering using the comparison mode, e.g. if the comparison mode is ComparisonMode.equality, the change event where the old and new values are equal will be silenced.

This support is not extended to cached Property. In fact, the comparison_mode on an Property seems to be never used.

When a property is cached, it is possible to compare the old and new value and filter the change event if old value equals new value. There are certainly use cases for this, e.g. see changes in traits_futures/traits_executor.py in https://github.com/enthought/traits-futures/pull/88/files

This issue is for discussing whether the filtering by comparison mode feature should be extended to cached property.

kitchoi avatar Jun 29 '20 13:06 kitchoi