[New-bugs-announce] [issue24623] Parser: broken line numbers for triple-quoted strings

Stefan Krah report at bugs.python.org
Sun Jul 12 21:41:18 CEST 2015


New submission from Stefan Krah:

IMO the string should start at lineno=1, col_offset=0.


$ ./python 
Python 3.6.0a0 (default:02b81a82a57d, Jul 12 2015, 20:33:44) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> a = ast.parse('''"""xxx
... yyy
... zzz"""''')
>>> ast.dump(a, include_attributes=True)
"Module(body=[Expr(value=Str(s='xxx\\nyyy\\nzzz', lineno=3, col_offset=-1), lineno=3, col_offset=-1)])"

----------
messages: 246665
nosy: skrah
priority: normal
severity: normal
status: open
title: Parser: broken line numbers for triple-quoted strings

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24623>
_______________________________________


More information about the New-bugs-announce mailing list