[IPython-dev] new way to go out of multi-line statements

Fernando Perez Fernando.Perez at colorado.edu
Sun Jan 29 03:32:48 EST 2006

Vivian De Smedt wrote:
> Dear All,
> I notice that when typing a multi-line statement in IPython we have to 
> type two consecutive full white space lines or one empty line to go out 
> of the multi-line mode instead on just one full white space line. Is it 
> a side effect of a bug correction or a new feature ?

This is also how the plain python shell behaves, to allow you to paste (or 
type) multiline code with blank lines in it (such as class definitions, where 
each method is typically separated by a blank line).

But note this, from the release notes:

Support for input with empty lines.  If you have auto-indent on, this means 
that you need to either hit enter _twice_, or add/remove a space to your last 
blank line, to indicate you're done entering input.  These changes also allow 
us to provide copy/paste of code with blank lines.

So you don't need a totally empty line: just adding or removing a single space 
will do.



More information about the IPython-dev mailing list