Skip to content

Conversation

jlstevens
Copy link
Contributor

We decided we wanted this boolean option independently of whether we implement the trigger method or not.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 78.078% when pulling 220b0a5 on onlychanged_watch_flag into 9179ba9 on master.

self_._watch('remove',watcher,parameter_name,parameter_attribute)
unwatched = True
except: pass
for onlychanged in [True, False]:
Copy link
Member

Choose a reason for hiding this comment

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

Are the watchers hashed based on their onlychanged value or why is this necessary?

Copy link
Member

Choose a reason for hiding this comment

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

Okay I see it, I'm happy to merge now but maybe we could consider changing the watchers to be a nested dict with keys of the form watchers[parameter_name][(parameter_attribute, fn)]. That way you don't need to replicate the whole watcher state on unwatch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is so named tuples match when removing from a list. If the value is different for onlychanged then it won't match. The alternative is to specify onlychanged as an argument which will only remove that type.

@philippjfr philippjfr merged commit 72f9b70 into master Sep 24, 2018
@philippjfr philippjfr deleted the onlychanged_watch_flag branch September 27, 2018 21:34
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.

3 participants