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

FIX: inconsistency between actual notebook output and Output.outputs #2351

Conversation

maartenbreddels
Copy link
Member

Fixes #2350
I think this approach of updating the outputs trait will always make the notebook's real output and the outputs trait the same.

@jasongrout
Copy link
Member

This looks right to me. Do you have a concrete example/list of steps showing the difference between status quo and this PR? You mentioned refreshing in the issue?

@maartenbreddels
Copy link
Member Author

import ipywidgets as widgets
from IPython.display import clear_output

output2 = widgets.Output()
with output2:
    print("in output2")
    clear_output(wait=True)
display(output2)

This will show in output2, but the widget state does not have the content anymore. If you refresh the notebook, nothing will be shown. With this PR it still is in the widget state and will be shown after a refresh.

@jasongrout
Copy link
Member

With this PR it still is in the widget state and will be shown after a refresh.

And, just checking, if you then display one more thing after the refresh, it replaces the output (i.e., the pending clear is still in effect?)

@maartenbreddels
Copy link
Member Author

No, the pending clear is not in any state, outside of the run of a single cell AFAIKT. For instance, using display/clear_display(wait=True) (without an Output widget) will only work in a single cell. This is consistent with nbconvert now as well jupyter/nbconvert#969 But I have not looked at the sourcecode of the classical notebook, this is purely observational.

@SylvainCorlay SylvainCorlay merged commit 29f5fb3 into jupyter-widgets:master Apr 23, 2019
@jasongrout jasongrout added this to the 7.5 milestone Jul 29, 2019
@lock lock bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output widget + clear_display(wait=True) bug/inconsistency
3 participants