Rob Cliffe writes:
> Perhaps where you're not laying out a table,
I'm an economist, laying out tables is what I do. :-) Getting
serious:
> but constructing a human-readable string? So
> s1 + ' ' + s2 + ' ' + s3
> or
> ' '.join((s1, s3, s3))
> would become
> s1 & s2 & s3
On 06/03/2023 15:49, Stephen J. Turnbull wrote:
Steven D'Aprano writes:
> I like the look of the & operator for concatenation, so I want to like
> this proposal. But I think I will need to see real world code to
> understand when it would be useful.
I have to second that motion. Pretty
Steven D'Aprano writes:
> I like the look of the & operator for concatenation, so I want to like
> this proposal. But I think I will need to see real world code to
> understand when it would be useful.
I have to second that motion. Pretty much any time I'm constructing
lines containing varia
On Mon, Mar 6, 2023 at 7:37 AM Steven D'Aprano wrote:
> (...)
> I like the look of the & operator for concatenation, so I want to like
> this proposal. But I think I will need to see real world code to
> understand when it would be useful.
>
I'd say we paint the shed blue.
I mean - maybe "|" is
On Mon, Mar 6, 2023 at 12:51 AM David Mertz, Ph.D.
wrote:
> Is it really that much longer to write `f"{s1} {s2}"` when you want that?
>
As for being that much longer: yes it is.
The more important factor is, I think, the increase in complexity +
readabiity for default strings is worth it in thi
On 06.03.2023 11:33, Steven D'Aprano wrote:
On Mon, Mar 06, 2023 at 10:33:26AM +0100, Marc-Andre Lemburg wrote:
def join_words(list_of_words)
return ' '.join([x.strip() for x in list_of_words])
That's not Rob's suggestion either.
I know, but as I mentioned, I use the above often, where
On Mon, Mar 06, 2023 at 10:33:26AM +0100, Marc-Andre Lemburg wrote:
> def join_words(list_of_words)
> return ' '.join([x.strip() for x in list_of_words])
That's not Rob's suggestion either.
Rob's suggestion is an operator which concats two substrings with
exactly one space between them, wit
On 02.03.2023 18:27, Rob Cliffe via Python-ideas wrote:
Tl;dr: Join strings together with exactly one space between non-blank
text where they join.
I propose a meaning for
s1 & s2
where s1 and s2 are strings.
Namely, that it should be equivalent to
s1.rstrip() + (' ' if (s1.strip() an