On Tue, Apr 24, 2012 at 4:41 AM, David Gowers (kampu) <[email protected]> wrote:
> On Tue, Apr 24, 2012 at 2:42 PM, Seth Hetu <[email protected]> wrote:
>> Huh, I never knew that Python included the newlines and spaces in
>> multi-line strings (probably because I only use them for doc comments,
>> which are post-formatted anyway).
>>
>> Hmm.... I can think of a few cases where it's useful to keep the
>> spaces, and a few cases where it's useful to strip them. Would a
>> function wrapper work with the current syntax? E.g.,
>>
>>         new textbox(remove_leading_ws("""
>>               Buck Star:
>>               Yes sensai Danielsan.""")
>>                    , 4, align:center, align:bottom)
>>
>
> IMO it's simpler (from a user's POV) to support implicit string
> compile-time string concatenation, than to have these stripping
> operators.
> For example,
>
>        new textbox("Buck Star:\n"
>                            "Yes sensai Danielsan", 4, align:center,
> align:bottom)
>
> This is also a property of Python. for example,
>
>        >>> s = ("foo"
>                      "bar")
>        >>> s
>        'foobar'
>
> (hopefully the above shows up normally, rather than as a triple email
> quotation :)
>
>
> TL;DR : Docstring style is neat if you really need to write a many
> lined string; if you just need a few lines, auto-concatenation is
> easier and more predictable to work with.

That's not really a multiline string, though, that's just a bunch of
strings glued together :)

I believe it is overall more useful to include any whitespace
wholesale. Yeah, it's ugly, but on the other hand, if you want those
leading spaces to be included, well, now you have a way.

The only problem I can forsee with this is tabs versus spaces. Does
the OHR handle tabs in any way? I don't recall...
-- 
Mike Caron
Tale of the Cave
http://taleotc.com
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to