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

Transitive rebinding #413

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

charlesbaynham
Copy link
Contributor

Adds support for transitive rebinding of parameters.

If fragment A has two children, B and C, support already existed for overriding C.my_param to depend on B.my_param then B.my_param to depend on A.my_param.

This PR lets you do it the other way around, giving the same final result but reversing the call order so you can first bind B.my_param to A.my_param, then C.my_param to B.my_param.

We found this need pop up when wanting to bind parameters between subfragments at the same hierarchical level.

I believe this comment is out of date, since in e.g. test_multi_rebind
_rebound_subfragment_params does indeed end up with two ParamHandles for the "value" parameter.
…esolved source.

This is not sensitive to the order in which
rebinds happen, and the ultimate source can be
found using _find_param_source. This doesn't
currently matter, but future code might find this
behaviour less surprising.

Note that _rebound_subfragment_params *is*
sensitive to the order in which binds happen.
This does not create redundant stores however, because init_params only
reads _get_all_handles_for_param for free params.
This doesn't currently matter, but might be confusing in future otherwise
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.

1 participant