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
 > saving you a bit of typing.  Just sayin'.

str '+' has long been quite rare in my coding.  str concatenation is
almost never in an inner loop, or slighly more complex formatting is
the point.  f-strings and .format save you the type conversion to str.
So I don't find that occasional saving at all interesting.  A
vanishingly small number of my str constructions involve only strs
with trivial formatting.

What interests me about the proposal is the space-collapsing part,
which a naive f-string would do incorrectly if, say, s2 == '' or s3 ==
'\t\t\ttabs to the left of me'.  But where does this space-surrounded
str data come from?

Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/HTEPBAI6EKXTUSU5SYZDZJUCOWHQN6C7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to