-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix: Inherit from LoggingConfigurable #6
Conversation
Can’t we do this in ipykernel? So comm has no dependency on traitlets? |
It has the dependency on the Traitlets package already, even though it does not provide trait classes for now. I don't have a strong opinion whether or not to do this in ipykernel, @blink1073 what do you think? |
I think it makes sense to use |
Indeed I will add a test |
d8fb299
to
0a306ce
Compare
0a306ce
to
e0a7b75
Compare
I strongly believe we shouldn't have a traitlets dependency in this package if we want to keep the comm package light weight. We can do multiple inheritance in ipykernel, which is the only place we need to be a LoggingConfigurable for backwards compatibility, or simply accept the |
@maartenbreddels we can probably discuss this in a separate issue later and fix ipykernel with this for now |
See ipython/ipykernel#1028 |
Note that this PR still doesn't make it fully backward compatible, because it does not inherit from LoggingConfigurable. Also, the whole point of the comm package IMHO, is to get rid of traitlets, and make it really lightweight. If we again inherit from any traitlets class, the comm package would again have to break compatibility in the future. I think it's ipykernel's responsibility to deliver backward compatibility. |
Right! I went a bit too fast, I fixed it |
Nothing stops you from providing your own Comm implementation that does not depend on traitlets. That's what xeus-python will do. |
Yes, but now we will still have bad performance in ipywidgets, because LoggingConfigurable is quite slow. If we use ipython/ipykernel#1028 we can have the ipykernel Comm class be backwards compatible, but the create_comm function create our light weight comm object (which is what we can do in ipywidgets). |
Are you saying you'd like ipywidgets to provide its own comm implementation? If yes, I strongly disagree with this, the kernel should provide the comm implementation, not libraries that make use of the comms. If we were to do that, kernels like xeus-python and pyolite (jupyterlite) would need to patch ipywidgets so that it does not interfere with the proper implementations. |
No, ipywidgets can use the |
This last thing wasn't in yet btw, but I added it in ipython/ipykernel@5032761 It's all about having the new API be clean, and still have ipykernel.comm.Comm be backward compatible. Does that make sense? |
I see! So basically with your PR:
Is that correct? |
Yes |
I wouldn't say this is great, it makes everything complex, but this is the price to pay to stay backward compatible. And maybe we should put a deprecation warning in the backward compatible Comm class, and tell people to use create_comm. |
Yes a deprecation warning sounds good. I like it! Thank you for opening a PR in ipykernel. I'm turning my PR into draft. |
Closing as replaced by ipython/ipykernel#1028 |
cc. @maartenbreddels
This was removed for performance concern, but it seems that people were relying on it being an
LoggingConfigurable
class.Fix ipython/ipykernel#1026