I get the same thing with '_i<n>' commands: In [4]: x = 12 In [5]: if x > 0: ...: print 'x is positive' ...: ...: In [9]: _i5 Out[9]: "if x > 0:\n print 'x is positive'\n \n\n" In [10]: %r _i5 Executing: _i5 Out[11]: "if x > 0:\n print 'x is positive'\n \n\n" -- -matt