It seems that the invocation of magic commands (e.g., ?,
%pcat, etc.) causes ipython to delay writing output
generated by any subsequently executed code to the console until the entire block of code in question is run. For instance, if one runs the following code
import time
for i in xrange(3):
print i
time.sleep(2)
from within ipython, accesses the help system with the ? command, and then attempts to run the above a second time, one will notice that no output is written to the console until the script finishes running.
I have observed this behavior using both ipython 0.8.2 and the latest development revision (104) on Linux with Python 2.5.2 (in both cases, I removed ~/.ipython prior to testing the behavior).