<div dir="auto">+1</div><br><div class="gmail_quote"><div dir="ltr">On Wed, 30 Jan 2019, 02:57 David Mertz <<a href="mailto:mertz@gnosis.cx">mertz@gnosis.cx</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>"Not every five line function needs to be in the standard library"</div><div><br></div><div>... even more true for every one line function.  I can think of a few dozen variations of similar but not quite identical behavior to my little stringify() that "could be useful."  Python gives us easy composition to create each of them.  It's not PHP, after all.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 29, 2019 at 8:52 PM Alex Shafer <<a href="mailto:ashafer@pm.me" target="_blank" rel="noreferrer">ashafer@pm.me</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br>-------- Original Message --------<br>On Jan 29, 2019, 18:44, David Mertz < <a href="mailto:mertz@gnosis.cx" target="_blank" rel="noreferrer">mertz@gnosis.cx</a>> wrote:<blockquote class="m_-6641604784535556895gmail-m_7388124147011146188protonmail_quote"><br><div dir="auto"><div>stringify = lambda it: type(it)(map(str, it))</div><div dir="auto"><br></div><div dir="auto">Done! Does that really need to be in the STDLIB?<br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Jan 29, 2019, 7:11 PM Alex Shafer via Python-ideas <<a href="mailto:python-ideas@python.org" target="_blank" rel="noreferrer">python-ideas@python.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">1) I'm in favor of adding a stringify method to all collections<br><br>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.<br><br><br><br>-------- Original Message --------<br>On Jan 29, 2019, 16:04, Steven D'Aprano < <a href="mailto:steve@pearwood.info" rel="noreferrer noreferrer" target="_blank">steve@pearwood.info</a>> wrote:<blockquote class="m_-6641604784535556895gmail-m_7388124147011146188m_1735470889629654284protonmail_quote"><br><p dir="ltr">On Tue, Jan 29, 2019 at 10:51:26PM +0100, Jamesie Pic wrote:</p>
<p dir="ltr">> What do you think of list.stringify(delim) ?</p>
<p dir="ltr">What's so special about lists? What do you think of:</p>
<p dir="ltr">tuple.stringify<br>
deque.stringify<br>
iterator.stringify<br>
dict.keys.stringify</p>
<p dir="ltr">etc. And what's so special about strings that lists have to support a<br>
stringify method and not every other type?</p>
<p dir="ltr">list.floatify<br>
list.intify<br>
list.tuplify<br>
list.setify<br>
list.iteratorify</p>
<p dir="ltr">Programming languages should be more about composable, re-usable general<br>
purpose components more than special cases.<br></p>
<p dir="ltr">--<br>
Steve<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</p>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></blockquote></div></div></div>
</blockquote></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-6641604784535556895gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons.  Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div></div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank" rel="noreferrer">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div>