Skip to content

Cell Transformation Issue for Multline Strings containing prompt strings #14600

Description

@tlikhit

Hello! I identified an issue with cell transformation for multiline strings containing ... or >>> where it strips out these characters.

Here's a minimal reproducible example:

❯ ipython
Python 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: '''
   ...: >>>
   ...: '''
Out[1]: '\n\n'

In [2]: '''
   ...: ...
   ...: '''
Out[2]: '\n\n'

For comparison , here's the same thing with python:

❯ python
Python 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)
[Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> '''
... >>>
... '''
'\n>>>\n'

>>> '''
... ...
... '''
'\n...\n'

I traced this back from unexpected Jupyter notebook behaviour related to the same

I have a fix for this that I'm testing. I'll send over a PR in a bit!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions