what happened to EventfulList and friends?
in IPython 3.0, I was importing EventfulList like so:
from IPython.utils.traitlets import EventfulList
In IPython 4.0, traitlets is abstracted, which is awesome by the way, but I can't find traitlets.eventful.
What am I missing?
Eventful was kept with widgets, which is the only thing in IPython that used it:
https://github.com/ipython/ipywidgets/blob/master/ipython_widgets/widgets/eventful.py
I need eventful containers (List, Dict and Set) in my application. The link above is not working. Can anyone suggest what is the recommended module to use now in 2017?
@jmsuresh I am unsure of why they were removed. However there is a pull request to implement them again - https://github.com/jupyter-widgets/ipywidgets/pull/1071
The above PR uses spectate under the hood:
pip install spectate
Check out the examples and let me know what you think.
Thanks for this. I was trying to test this but could not as it depends on FrozenBunch which is not available in the version I have. Any suggestions? I am trying to use this eventful container to do a clean MVC pattern for a GUI. I am wondering why there is no popular way to do this as this requirement should be very common.
@jmsuresh, I am trying to find time to uncouple the pull request from its dependance on the (as yet) unreleased 5.0 version of traitlets. However even when I do, that branch will probably be unstable since its a WIP and will need to respond to changes during review.
The reason eventful traits haven't been done before is twofold:
- It's hard and requires a deep knowledge of traitlets to implement (which few people have).
- It is possible to trigger change notifications if you assign a new instance to the trait.
- this is obviously not ideal though.