Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Jan 21, 2018

is complicated and hard to understand, so it's highly recommended that you use
raw strings for all but the simplest expressions.
sequence isn't recognized by Python's parser, it will generate a
:exc:`DeprecationWarning` and in the future this will become a :exc:`Syntaxerror`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Syntaxerror -> SyntaxError

@csabella
Copy link
Contributor

IMHO, I actually thought the warning about the DeprecationWarning and SyntaxError should come in one of the introduction paragraphs since the raw strings are discussed there.

In the paragraph that starts with, Regular expressions use the backslash character, maybe a line at the end with something like 'Also, please note that any invalid escape sequences in Python's usage of the backslash now generate a DeprecationWarning and, in the future, a SyntaxError. This will happen even if it is a valid escape sequence for a regular expression.'

@pablogsal
Copy link
Member Author

Thank you very much @csabella. I have added some lines as you suggested in the introductory paragraphs.

backslash must be expressed as ``\\`` inside a regular Python string
literal.
literal. Also, please note that any invalid escape sequences in Python's
usage of the backslash in string literals now generate a DeprecationWarning
Copy link
Member

Choose a reason for hiding this comment

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

Could you use a link to the DeprecationWarning exception like that

:exc:`DeprecationWarning`

same for the SyntaxError exception

@pablogsal
Copy link
Member Author

CC: @JulienPalard

@pablogsal pablogsal merged commit e8239b8 into python:master Jan 20, 2019
@pablogsal pablogsal deleted the bpo32603 branch January 20, 2019 18:58
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.

5 participants