2.4.2 串字面值的连接 String literal concatenation

Multiple adjacent string literals (delimited by whitespace), possibly using different quoting conventions, are allowed, and their meaning is the same as their concatenation. Thus, "hello" 'world' is equivalent to "helloworld". This feature can be used to reduce the number of backslashes needed, to split long strings conveniently across long lines, or even to add comments to parts of strings, for example:

多个相邻的串字面值(由空白分隔), 可能使用不同的引用习惯, 是允许的, 并且它的含义在连接时是一样的行.因此, "hello""world"等价于"helloworld".这个待征可以用来减少原本要使用的反斜线的数目, 可以把一个长串分隔在多行上,下班甚至在串的某个部分加上注释, 例如:

re.compile("[A-Za-z_]"       # letter or underscore
           "[A-Za-z0-9_]*"   # letter, digit or underscore
          )

Note that this feature is defined at the syntactical level, but implemented at compile time. The `+' operator must be used to concatenate string expressions at run time. Also note that literal concatenation can use different quoting styles for each component (even mixing raw strings and triple quoted strings).

注意这个功能是定义在句法层次上的, 但是是在编译时实现的.在运行时连接串必须使用 "+"运算符. 并且不同的引用字符可以混用, 甚至可以将原始串与三重引用串混着用.