Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the '-' pattern for on_trait_change. #1592

Merged
merged 5 commits into from
Nov 8, 2021

Conversation

mdickinson
Copy link
Member

Fixes #1589.

registers one trait-level notifier for each trait on the target object,
while the ``"-"`` pattern registers a single *object*-level notifier on the
target object. As a result, a
``some_object.on_trait_change(handler, "-")`` call may be more performant
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest something more general, like "may have different performance characteristics" - I can see situations where either might be better depending on the number of traits, how often instances are created and how often they change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mdickinson mdickinson merged commit 0687f9b into main Nov 8, 2021
@mdickinson mdickinson deleted the doc/document-any-trait-with-minus branch November 8, 2021 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document meaning of "some_trait.-" as an on_trait_change extended name
3 participants