Hello, multiline string By recently studying a game scripting language (*), and designing a toy language of mine, I realised the following 2 facts, that may be relevant for python as well: -1- no need for a separate multiline string notation A single string format can deal text including newlines, without any syntactic or parsing (**) issue: a string notation just ends with the second quote. No idea why python introduced that distinction (and would like to know it); possibly for historic reason? The only advantage of """...""" seems to be that this format allows literal quotes in strings; am I right on this? -2- trimming of indentation On my computer, calling the following function: def write(): if True: print """To be or not to be, that is the question.""" results in the following output: |To be or not to be, | that is the question. This is certainly not the programmer's intent. To get what is expected, one should write instead: def write(): if True: print """To be or not to be, that is the question.""" ...which distorts the visual presentation of code by breaking correct indentation. To have a multiline text written on multiple lines and preserve indentation, one needs to use more complicated forms like: def write(): if True: print "To be or not to be,\n" + \ "that is the question." (Actually, the '+' can be here omitted, but this fact is not commonly known.) My project uses a visual structure à la python (and no curly braces). Indentation is removed by the arser from the significant part of code even inside strings (and also comments). This allows the programmer preserving clean source outline, while having multiline text be simply written as is. In other words, the following routine would work as you guess (':' is assignment sign): write : action if true terminal.write "To be or not to be, that is the question." I imagine the python parser replaces indentation by block-delimiting tokens (analog in role to C braces). My language's parser thus has a preprocessing phase that would transform the above piece of code above to: write : action { if true { terminal.write "To be or not to be, that is the question." } } The preprocess routine is actually easier than it would be with python rules, since one can trim indents systematically, without any exception for strings (and comments). Thank you for reading, Denis (*) namely WML, scripting language of the game called Wesnoth (**) This is true for 1-pass parsers (like PEG), as well as for 2-pass ones (with separate lexical phase). -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com