Issue 33068: Inconsistencies in parsing (evaluating?) longstrings (original) (raw)

Issue33068

Created on 2018-03-13 12:50 by dlukes, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg313745 - (view) Author: David Lukeš (dlukes) * Date: 2018-03-13 12:50
""" \""" """ evaluates to ' """ ' (as expected), but without the surrounding spaces, """\"""""" evaluates to '"' instead of '"""'. Is this expected behavior? If I'm reading the definition of string syntax in https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals correctly, it shouldn't be.
msg313746 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-03-13 13:07
"""\"""""" is parsed as """\"""" "": a triple-quoted string containing an escaped '"', followed by an empty single-quoted string.
msg313748 - (view) Author: David Lukeš (dlukes) * Date: 2018-03-13 13:52
Oh, right, of course! Sorry and thanks for taking the time to clarify that :)
History
Date User Action Args
2022-04-11 14:58:58 admin set github: 77249
2018-03-13 13:52:10 dlukes set messages: +
2018-03-13 13:07:05 serhiy.storchaka set status: open -> closednosy: + serhiy.storchakamessages: + resolution: not a bugstage: resolved
2018-03-13 12:50:49 dlukes create