Description
This only applies to the base python
repl, everything works in IPython
repls.
In discussion on b2fbae7 discovered that sys.displayhook
only gets evaluated for expressions, not statements.
This means that things like
import numpy
pass
a = b
will not trigger the auto-redrawing. This is particularly troubling because this mean
ln, = ax.plot(...)
will not trigger a re-draw, but
ax.plot(...)
will.
Due to b2fbae7, where we rely on the auto-redrawing to trigger the pyplot
redrawing this means that many pyplot
workflows in the normal repl are broken (as in things that used to auto-redraw no longer do).
The options I think are:
- figure out how to trigger a call back on statements (if this is possible, it is well hidden. There may be a reason IPython completely re-wrote the execution handling)
- say we only support interactive plotting with the IPython repl (which is a major regression)
- revert the removal of
draw_if_interactive
which maintains some functions as 'special'
I suspect that the answer is going to be both 2 and 3. normal python shell keeps current functionality and gains some new functionality, IPython picks up lots of new functionality, and the code base keeps this particular wart.