bundles / traitlets 5.14.3 / traitlets / traitlets / directional_link
class
traitlets.traitlets:directional_link
source: /traitlets/traitlets.py :348
Signature
class directional_link ( source : t.Any , target : t.Any , transform : t.Any = None ) → None Members
Summary
Link the trait of a source object with traits of target objects.
Parameters
source: (object, attribute name) pairtarget: (object, attribute name) pairtransform: callable (optional)Data transformation between source and target.
Examples
class X(HasTraits): value = Int()
src = X(value=1) tgt = X(value=42) c = directional_link((src, "value"), (tgt, "value"))Setting source updates target objects:
src.value = 5 tgt.valueSetting target does not update source object:
tgt.value = 6 src.value
Aliases
-
traitlets.directional_link