Opened 15 years ago

Closed 15 years ago

# [with patch; positive review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

Reported by: Owned by: William Stein Kelly Boothby major sage-3.0.2 notebook N/A

To replicate this bug:

1. Put show(plot(sin)) in a cell and press shift-enter
1. Then in the *same* cell *delete* show(plot(sin)) and replace it by this and press shift-enter:
```@interact
def _(n=(1,100)):
print n^2
```
1. Observe that the plot of sin is still there.

### comment:1 Changed 15 years ago by William Stein

Description: modified (diff)

### comment:2 Changed 15 years ago by William Stein

Summary: notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) → [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

### comment:3 Changed 15 years ago by Kelly Boothby

Summary: [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) → [with patch; negative review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

The following is now broken:

```plot(sin,0,1).show()
@interact
def foo(a="1"):
a
```

### comment:4 Changed 15 years ago by William Stein

Summary: [with patch; negative review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) → [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

Hi,

Your only reason for giving a negative review was a claim that

```plot(sin,0,1).show()
@interact
def foo(a="1"):
a
```

is now "broken". However, this never did what you thought it did. The behavior in fact hasn't changed at all from how it was before, except to remove the bug where old graphics from the previous version of the cell remained.

@interact *by design* is only supposed to work when it is the only thing in a cell.

Having multiple interacts in a cell, having additional graphics in a cell, having nested interacts -- none of that should work at present, since none of it has been implemented. They're all things that would possibly be very nice to implement, but they were not part of the design goals for the first version of interact.

### comment:5 Changed 15 years ago by Kelly Boothby

Summary: [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) → [with patch; positive review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

It was not clear to me, even upon rereading the documentation, that @interact had to be alone in a cell. The attached "fixes" the issue. :)

### comment:6 Changed 15 years ago by Michael Abshoff

Resolution: → fixed new → closed

Merged both patches in Sage 3.0.2.alpha1

Note: See TracTickets for help on using tickets.