This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Inconsistencies in parsing (evaluating?) longstrings
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: dlukes, serhiy.storchaka
Priority: normal Keywords:

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:58adminsetgithub: 77249
2018-03-13 13:52:10dlukessetmessages: + msg313748
2018-03-13 13:07:05serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg313746

resolution: not a bug
stage: resolved
2018-03-13 12:50:49dlukescreate