mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
gh-55688: Add note about ending backslashes for raw strings (#94768)
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
This commit is contained in:
parent
5369bba8c5
commit
b95b1b3b25
2 changed files with 45 additions and 0 deletions
|
@ -189,6 +189,11 @@ the first quote::
|
|||
>>> print(r'C:\some\name') # note the r before the quote
|
||||
C:\some\name
|
||||
|
||||
There is one subtle aspect to raw strings: a raw string may not end in
|
||||
an odd number of ``\`` characters; see
|
||||
:ref:`the FAQ entry <faq-programming-raw-string-backslash>` for more information
|
||||
and workarounds.
|
||||
|
||||
String literals can span multiple lines. One way is using triple-quotes:
|
||||
``"""..."""`` or ``'''...'''``. End of lines are automatically
|
||||
included in the string, but it's possible to prevent this by adding a ``\`` at
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue