[Python-Dev] eval and triple quoted strings (original) (raw)
Ron Adam ron3200 at gmail.com
Fri Jun 14 20:11:11 CEST 2013
- Previous message: [Python-Dev] eval and triple quoted strings
- Next message: [Python-Dev] eval and triple quoted strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 06/14/2013 10:36 AM, Guido van Rossum wrote:
Not a bug. The same is done for file input -- CRLF is changed to LF before tokenizing.
Should this be the same?
python3 -c 'print(bytes("""\r\n""", "utf8"))' b'\r\n'
eval('print(bytes("""\r\n""", "utf8"))') b'\n'
Ron
On Jun 14, 2013 8:27 AM, "Walter Dörwald" <walter at livinglogic.de_ _<mailto:walter at livinglogic.de>> wrote:
Hello all! This surprised me: >>> eval("'''\r\n'''") '\n' Where did the \r go? ast.literaleval() has the same problem: >>> ast.literaleval("'''\r\n'''") '\n' Is this a bug/worth fixing? Servus, Walter
Python-Dev mailing list Python-Dev at python.org <mailto: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>
- Previous message: [Python-Dev] eval and triple quoted strings
- Next message: [Python-Dev] eval and triple quoted strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]