[IPython-User] Tips working around a bug in IPython 13.2

Aaron Meurer asmeurer@gmail....
Sat Jun 8 21:43:53 CDT 2013


In IPython 13.2, there seems to be a bug, where something like

def f():
    """
    >>> for i in range(10):
    ...     print i
    """

is converted into

def f():
    """
    >>> for i in range(10):
    print i
    """

I am trying to use
https://github.com/catherinedevlin/ipython_doctester, and this is
making it impossible to use multiline doctests.

It appears that this bug has been fixed in the IPython git master, but
I am using this for the SymPy SciPy tutorial, so everyone will be
using 13.2 (or potentially earlier).

What is the best way to work around this? Is there a one-liner I can
put at the top of the notebooks? Even if there is a longer monkey
patch, I can put it in a file and run that file at the top of the
notebook.

Aaron Meurer


More information about the IPython-User mailing list