bpo-32603: Deprecation warning on strings used in re module#5255
bpo-32603: Deprecation warning on strings used in re module#5255pablogsal merged 1 commit intopython:masterfrom
Conversation
4ec44c2 to
9c95baf
Compare
Doc/library/re.rst
Outdated
| 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`. |
There was a problem hiding this comment.
Syntaxerror -> SyntaxError
|
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, |
|
Thank you very much @csabella. I have added some lines as you suggested in the introductory paragraphs. |
Doc/library/re.rst
Outdated
| 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 |
There was a problem hiding this comment.
Could you use a link to the DeprecationWarning exception like that
:exc:`DeprecationWarning`
same for the SyntaxError exception
cded1bd to
85c4cf9
Compare
…s in the re module
|
CC: @JulienPalard |
https://bugs.python.org/issue32603