[Python-ideas] Add list.join() please

Alex Shafer ashafer at pm.me
Tue Jan 29 20:52:37 EST 2019


That would be strongly preferred to duplication across hundreds of use cases and thousands (millions?) of users. Not all of them are likely to come up with the most efficient implementation either.
-------- Original Message --------
On Jan 29, 2019, 18:44, David Mertz wrote:

> stringify = lambda it: type(it)(map(str, it))
>
> Done! Does that really need to be in the STDLIB?
>
> On Tue, Jan 29, 2019, 7:11 PM Alex Shafer via Python-ideas <python-ideas at python.org wrote:
>
>> 1) I'm in favor of adding a stringify method to all collections
>>
>> 2) strings are special and worthy of a "special case" because strings tend to be human readable and are used in all kinds of user interface.
>>
>> -------- Original Message --------
>> On Jan 29, 2019, 16:04, Steven D'Aprano < steve at pearwood.info> wrote:
>>
>>> On Tue, Jan 29, 2019 at 10:51:26PM +0100, Jamesie Pic wrote:
>>>
>>>> What do you think of list.stringify(delim) ?
>>>
>>> What's so special about lists? What do you think of:
>>>
>>> tuple.stringify
>>> deque.stringify
>>> iterator.stringify
>>> dict.keys.stringify
>>>
>>> etc. And what's so special about strings that lists have to support a
>>> stringify method and not every other type?
>>>
>>> list.floatify
>>> list.intify
>>> list.tuplify
>>> list.setify
>>> list.iteratorify
>>>
>>> Programming languages should be more about composable, re-usable general
>>> purpose components more than special cases.
>>>
>>> --
>>> Steve
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190130/d269055e/attachment-0001.html>


More information about the Python-ideas mailing list