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. > > >
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