[Python-checkins] r70893 - python/trunk/Doc/tutorial/introduction.rst

georg.brandl python-checkins at python.org
Tue Mar 31 22:56:32 CEST 2009


Author: georg.brandl
Date: Tue Mar 31 22:56:32 2009
New Revision: 70893

Log:
#1530012: move TQS section before raw strings.

Modified:
   python/trunk/Doc/tutorial/introduction.rst

Modified: python/trunk/Doc/tutorial/introduction.rst
==============================================================================
--- python/trunk/Doc/tutorial/introduction.rst	(original)
+++ python/trunk/Doc/tutorial/introduction.rst	Tue Mar 31 22:56:32 2009
@@ -199,21 +199,6 @@
    several lines of text just as you would do in C.
        Note that whitespace at the beginning of the line is significant.
 
-If we make the string literal a "raw" string, however, the ``\n`` sequences are
-not converted to newlines, but the backslash at the end of the line, and the
-newline character in the source, are both included in the string as data.  Thus,
-the example::
-
-   hello = r"This is a rather long string containing\n\
-   several lines of text much as you would do in C."
-
-   print hello
-
-would print::
-
-   This is a rather long string containing\n\
-   several lines of text much as you would do in C.
-
 Or, strings can be surrounded in a pair of matching triple-quotes: ``"""`` or
 ``'''``.  End of lines do not need to be escaped when using triple-quotes, but
 they will be included in the string. ::
@@ -230,6 +215,20 @@
         -h                        Display this usage message
         -H hostname               Hostname to connect to
 
+If we make the string literal a "raw" string, ``\n`` sequences are not converted
+to newlines, but the backslash at the end of the line, and the newline character
+in the source, are both included in the string as data.  Thus, the example::
+
+   hello = r"This is a rather long string containing\n\
+   several lines of text much as you would do in C."
+
+   print hello
+
+would print::
+
+   This is a rather long string containing\n\
+   several lines of text much as you would do in C.
+
 The interpreter prints the result of string operations in the same way as they
 are typed for input: inside quotes, and with quotes and other funny characters
 escaped by backslashes, to show the precise value.  The string is enclosed in


More information about the Python-checkins mailing list