Starting in IPython 9.10.0 the following code no longer strips doctest prompts correctly (with both standard doctest style as well as the extended xdoctest style - which I would love if we kept support for).
Consider 3 doctest style with multiline strings. The first one is supported by standard doctest, the later are supported by xdoctest as well.
python -c 'if 1:
import textwrap
from IPython.core.inputtransformer2 import TransformerManager
q = chr(39) * 3
cell = textwrap.dedent(
f"""
>>> x = (
... r{q}
... hello
... {q})
""")
got = TransformerManager().transform_cell(cell)
print(got)
'
python -c 'if 1:
import textwrap
from IPython.core.inputtransformer2 import TransformerManager
q = chr(39) * 3
cell = textwrap.dedent(
f"""
>>> x = (
>>> r{q}
>>> hello
>>> {q})
""")
got = TransformerManager().transform_cell(cell)
print(got)
'
python -c 'if 1:
import textwrap
from IPython.core.inputtransformer2 import TransformerManager
q = chr(39) * 3
cell = textwrap.dedent(
f"""
>>> x = (
r{q}
hello
{q})
""")
got = TransformerManager().transform_cell(cell)
print(got)
'
On version 9.9.0 I correctly get:
x = (
r'''
hello
''')
x = (
r'''
hello
''')
x = (
r'''
hello
''')
Starting in 9.10.0 I get incorrect stripping for the first two:
x = (
... r'''
... hello
... ''')
x = (
>>> r'''
>>> hello
>>> ''')
x = (
r'''
hello
''')
This looks like it is a result of: #15110
Starting in IPython 9.10.0 the following code no longer strips doctest prompts correctly (with both standard doctest style as well as the extended xdoctest style - which I would love if we kept support for).
Consider 3 doctest style with multiline strings. The first one is supported by standard doctest, the later are supported by xdoctest as well.
On version
9.9.0I correctly get:Starting in 9.10.0 I get incorrect stripping for the first two:
This looks like it is a result of: #15110