diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-12 21:46:19 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-12 21:46:19 (GMT) |
commit | 3a5d4cb940d9f06505b0b65916fd9a844bed13e3 (patch) | |
tree | 4f76dccee7b943c2d421442240892fe711401053 /Doc/reference/lexical_analysis.rst | |
parent | b63a450cc4c69c4e8668aa434a37b2aa213e94e0 (diff) | |
download | cpython-3a5d4cb940d9f06505b0b65916fd9a844bed13e3.zip cpython-3a5d4cb940d9f06505b0b65916fd9a844bed13e3.tar.gz cpython-3a5d4cb940d9f06505b0b65916fd9a844bed13e3.tar.bz2 |
Issue #13748: Raw bytes literals can now be written with the `rb` prefix as well as `br`.
Diffstat (limited to 'Doc/reference/lexical_analysis.rst')
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 5900daa..c20c47e 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -412,7 +412,7 @@ String literals are described by the following lexical definitions: .. productionlist:: bytesliteral: `bytesprefix`(`shortbytes` | `longbytes`) - bytesprefix: "b" | "B" | "br" | "Br" | "bR" | "BR" + bytesprefix: "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB" shortbytes: "'" `shortbytesitem`* "'" | '"' `shortbytesitem`* '"' longbytes: "'''" `longbytesitem`* "'''" | '"""' `longbytesitem`* '"""' shortbytesitem: `shortbyteschar` | `bytesescapeseq` @@ -446,6 +446,10 @@ 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. + .. versionadded:: 3.3 + The ``'rb'`` prefix of raw bytes literals has been added as a synonym + of ``'br'``. + 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 "quote" is the character used to open the string, i.e. either ``'`` or ``"``.) |