diff options
author | Christian Heimes <c.heimes@cheimes.de> | 2012-06-20 09:17:58 (GMT) |
---|---|---|
committer | Christian Heimes <c.heimes@cheimes.de> | 2012-06-20 09:17:58 (GMT) |
commit | 0b3847de6dbe451d38d8de940717a5a1f186c2e9 (patch) | |
tree | 62f54dd84693e7b25deae94699b8c240d824b806 /Doc/reference | |
parent | 10c8791978203be95af2c4c1d7ce33496fac880c (diff) | |
download | cpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.zip cpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.tar.gz cpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.tar.bz2 |
Issue #15096: Drop support for the ur string prefix
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index c94a47f..5e5903f 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -401,7 +401,7 @@ String literals are described by the following lexical definitions: .. productionlist:: stringliteral: [`stringprefix`](`shortstring` | `longstring`) - stringprefix: "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR" + stringprefix: "r" | "u" | "R" | "U" shortstring: "'" `shortstringitem`* "'" | '"' `shortstringitem`* '"' longstring: "'''" `longstringitem`* "'''" | '"""' `longstringitem`* '"""' shortstringitem: `shortstringchar` | `stringescapeseq` @@ -444,19 +444,21 @@ must be expressed with escapes. As of Python 3.3 it is possible again to prefix unicode strings with a ``u`` prefix to simplify maintenance of dual 2.x and 3.x codebases. -Both string and bytes literals may optionally be prefixed with a letter ``'r'`` +Bytes literals may optionally be prefixed with a letter ``'r'`` or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as literal characters. As a result, in string literals, ``'\U'`` and ``'\u'`` -escapes in raw strings are not treated specially. +escapes in raw strings are not treated specially. Given that Python 2.x's raw +unicode literals behave differently than Python 3.x's the ``'ur'`` syntax +is not supported. .. versionadded:: 3.3 The ``'rb'`` prefix of raw bytes literals has been added as a synonym of ``'br'``. .. versionadded:: 3.3 - Support for the unicode legacy literal (``u'value'``) and other - versions were reintroduced to simplify the maintenance of dual - Python 2.x and 3.x codebases. See :pep:`414` for more information. + Support for the unicode legacy literal (``u'value'``) was reintroduced + to simplify the maintenance of dual Python 2.x and 3.x codebases. + See :pep:`414` for more information. In triple-quoted strings, unescaped newlines and quotes are allowed (and are retained), except that three unescaped quotes in a row terminate the string. (A |