Hot to split string literals that will across two or more lines ?

Steven D'Aprano steve at
Sat Nov 19 03:35:16 CET 2005

On Fri, 18 Nov 2005 15:59:30 +1100, Ben Finney wrote:

> Tony Nelson <*firstname*nlsnews at georgea*lastname*.com> wrote:
>> While we're at it, I use bracketing instead of line continuation:
>>     print ( "a long string, longer than this "
>>             "and some more of the string" )
> To continue the pedantry: Those are parentheses, not brackets.

To out-pedant your pedantry, "bracket" is a general term for any and all
of the various punctuation marks used to bracket a substring or phrase.
Brackets include:

parentheses or round brackets ( )
square brackets [ ]
braces or curly brackets { }
chevrons or angle brackets 〈 〉

The symbols for chevrons are not available on common keyboards, are not
available in ordinary ASCII, and may not show up correctly in many
typefaces, so a common alternative is to substitute less than and greater
than signs < > as brackets. HTML and XML use that convention.

Note that "square brackets" is the formal name for the specific
brackets which are square: the adjective is not redundant.

Double chevrons « » (and occasionally single) are used as quotation
marks in some European languages, for instance French and Italian, and
sometimes Dutch. When used as quote marks, the French term guillemet is
sometimes used as synonym for chevron.


More information about the Python-list mailing list