[Python-ideas] The non-obvious nature of str.join (was Re: sum(...) limitation)

Todd toddrjen at gmail.com
Mon Aug 11 18:24:35 CEST 2014


On Mon, Aug 11, 2014 at 6:22 PM, Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:

>
> On Mon, Aug 11, 2014 at 11:55 AM, Todd <toddrjen at gmail.com> wrote:
>
>> In my experience, it is the asymmetry between x.join(y) and x.split(y)
>>> which causes most of the confusion.  In x.join(y), x is the separator and y
>>> is the data being joined, but in x.split(y), it is the other way around.
>>>
>>
>> What would be the solution to this?
>>
>
> Allow sum(list_of_strings, '') and stop mocking people who prefer it to
> ''.join(..).  This will not solve all the issues with join/split, but at
> least a simple task of concatenating a list of strings will have a more or
> less obvious solution.
>

I am confused, if it won't solve the problem, how is it relevant to my
question?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140811/ba62cc1e/attachment-0001.html>


More information about the Python-ideas mailing list