A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/050121.html below:

[Python-Dev] String literal concatenation & docstrings

[Python-Dev] String literal concatenation & docstrings [Python-Dev] String literal concatenation & docstringsort orbitz at drorbitz.ath.cx
Sat Nov 27 05:01:24 CET 2004
Like anything, if you need to wrap a statement around multiple lines, 
you surround it in ()'s

Now the question is why does:
 >>> def foo():
...     ("""blah"""
...     """fejlfe""")
...     pass
...
 >>> help(foo)

Not show that as the doc string. Just because it has () doesn't mean it 
evaluates to anything other than a string as far as I know.



Carlos Ribeiro wrote:

>On Fri, 26 Nov 2004 11:56:05 -0800, Brett C. <bac at ocf.berkeley.edu> wrote:
>  
>
>>Should probably change the wording on that unless people actually want the
>>literal string concatenation to work with statements (docstrings seem like the
>>only place that would be reasonable) unless you want to start allowing print
>>statements to have a string part span multiple lines.  =)
>>    
>>
>
>It means that:
>
>    print "this line continues"
>          "on the next line"
>
>does not work, while the following works:
>
>    a = "this line continues"
>        "on the next line"
>
>Kind of weird, but anyway, that's not a common idiom. One more reason
>to use triple-quoted-strings when printing long strings.
>
>  
>

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4