[Python-ideas] Re: Ampersand operator for strings

2023-03-05 Thread Steven D'Aprano
On Sun, Mar 05, 2023 at 10:49:12PM -0500, David Mertz, Ph.D. wrote: > Is it really that much longer to write `f"{s1} {s2}"` when you want that? That's not the same as Rob's proposal. -- Steve ___ Python-ideas mailing list -- python-ideas@python.org T

[Python-ideas] Re: Ampersand operator for strings

2023-03-05 Thread David Mertz, Ph.D.
Is it really that much longer to write `f"{s1} {s2}"` when you want that? Maybe a couple characters more total, but once you are in an f-string, you can also do a zillion other things at the same time. On Sun, Mar 5, 2023 at 10:42 PM Rob Cliffe via Python-ideas < python-ideas@python.org> wrote:

[Python-ideas] Ampersand operator for strings

2023-03-05 Thread Rob Cliffe via Python-ideas
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() and s2.strip()) else '') + s2.lstrip() Informally, this wil