A fork to traitlets' link and dlink to link traits in addition to traitlets.
Make sure you have pip installed and run:
pip install link_traits
link_traits depends on traits which is not a pure Python package. In Anaconda you can install link_traits and traits as follows:
conda install link-traits -c conda-forge
Running the tests
py.test is required to run the tests.
pip install "link_traits[test]" py.test --pyargs traitlets
import traits.api as t import traitlets from link_traits import link class A(t.HasTraits): a = t.Int() class B(traitlets.HasTraits): b = t.Int() a = A() b = B() l = link((a, "a"), (b, "b"))
>>> a.a = 3 >>> b.b 3
Contributions through pull requests are welcome. The intention is to keep the syntax and features in sync with the original traitlets’ link and dlink functions. Therefore, before contributing a new feature here, please contribute it to traitlets first.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size link_traits-1.0.2-py2.py3-none-any.whl (7.3 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
|Filename, size link_traits-1.0.2.tar.gz (7.2 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for link_traits-1.0.2-py2.py3-none-any.whl