Bug or feature: double strings as one

Jan Kaliszewski zuo at chopin.edu.pl
Mon Aug 10 01:26:00 CEST 2009


09-08-2009 o 23:43:14 r <rt8396 at gmail.com> wrote:

> #-- el bueno --#
> "hello i am a very long string that\
> does not like newlines so please \
> escape me, Thank you!"

You probably ment: """hello i am... [etc.]

Anyway... You're right that generally it's good idea to define
dialog prompts and such stuff separately rather that to hardcode
it, especially in big projects. Then certainly multiline
string literals are useful (though, if you need to get rid of
newlines, IMHO "el feo" method is more elegant and less error
prone than your "el bueno" [possible invisible space after '\']).

But there are plenty of other situations when it's better
(in practice) to have strings (even long) together with your
code, e.g. log information for debugging, or

Cheers,

*j



More information about the Python-list mailing list