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

FIX: Don't notify on empty 'update's of Dict traits #1308

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Oct 13, 2020

This PR modifies the TraitDict.update method so that notifications are not issues when updating with an empty argument. This is similar to the behaviour of extending a list or updating a set with an empty argument.

The PR also adds a test for the TraitDict.clear method, to verify that it doesn't notify when clearing an already-empty dictionary.

Fixes #1307

Checklist

  • Tests
  • Update API reference (docs/source/traits_api_reference) Not needed
  • Update User manual (docs/source/traits_user_manual) Not needed
  • Update type annotation hints in traits-stubs Not needed

@mdickinson mdickinson changed the title Don't notify on empty 'update's of Dict traits FIX: Don't notify on empty 'update's of Dict traits Oct 13, 2020
Copy link
Contributor

@corranwebster corranwebster left a comment

Choose a reason for hiding this comment

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

LGTM

@mdickinson mdickinson merged commit c2018dc into master Oct 14, 2020
@mdickinson mdickinson deleted the fix/trait-dict-empty-update branch October 14, 2020 07:07
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.

TraitDict should not emit notifications for empty updates
2 participants