enthought / enthought/traits

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

Open
#1,232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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.

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.