[Python-Dev] eval and triple quoted strings

Guido van Rossum guido at python.org
Fri Jun 14 17:36:48 CEST 2013


Not a bug. The same is done for file input -- CRLF is changed to LF before
tokenizing.
On Jun 14, 2013 8:27 AM, "Walter Dörwald" <walter at livinglogic.de> wrote:

> Hello all!
>
> This surprised me:
>
>    >>> eval("'''\r\n'''")
>    '\n'
>
> Where did the \r go? ast.literal_eval() has the same problem:
>
>    >>> ast.literal_eval("'''\r\n'''")
>    '\n'
>
> Is this a bug/worth fixing?
>
> Servus,
>    Walter
> ______________________________**_________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/**mailman/listinfo/python-dev<http://mail.python.org/mailman/listinfo/python-dev>
> Unsubscribe: http://mail.python.org/**mailman/options/python-dev/**
> guido%40python.org<http://mail.python.org/mailman/options/python-dev/guido%40python.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130614/e8a158fb/attachment.html>


More information about the Python-Dev mailing list