Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 12, 2019

This PR makes raw string literals "true" raw. A backslash no longer has any special meaning and can be used as the end character (e.g. in r"C:\User\"). But on other hand quotes no longer be escaped, so some raw string literals ( exclusively for regular expressions) should be rewritten.

This PR is for demonstration purpose only. It will not be merged.

| " [^"\\\n]* (?: \\. [^"\\\n]* )* "?
''' r"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glenn proposed also other method: replace """ and ''' in REs with "{3} and '{3} correspondingly.

You can also inserts a backslash in the middle of triple quotes: "\"" or ""\".

@serhiy-storchaka serhiy-storchaka deleted the raw-string-backslash branch October 7, 2019 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants