On Thu, Oct 17, 2019 at 01:42:54PM +0200, Anders Hovmöller wrote:
> The multiply a list/string thing is a big mistake imo. You almost
> never use it so the cost of not having it is almost nothing while the
> cost of having type errors propagate beyond the point where they
> happened is big.
I use string repetition and concatenation frequently. For example, for
indenting a string I much prefer this:
string = " "*n + string
over something like
string = ''.join([''.join(' ' for __ in range(n)), string])
List repetition, not so often, but I do use list concatenation and even
more so tuple concatenation.
So I disagree that they are "almost never" used, or that they are a
mistake. If we didn't have string `+` and `*`, and list `+`, I would
certainly have to roll my own as functions.
--
Steven
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/M64BZX4C2MF4VZPY4L4PNEOWHEHBFT2Y/
Code of Conduct: http://python.org/psf/codeofconduct/