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

Alexander Belopolsky alexander.belopolsky at gmail.com
Mon Aug 11 17:47:29 CEST 2014


On Mon, Aug 11, 2014 at 10:59 AM, Mark Lawrence <breamoreboy at yahoo.co.uk>
wrote:

> Could you try something which to my understanding is unprecedented in the
> world of computing, as in point them to the docs?


Sure - this is the universal remedy to any design mistake, but how many
people would need to look at the docs to understand something like
join(list, sep=',') or split(string, sep=',')?  And how many of those
seeing x.join(y) and x.split(y) for the first time will guess which
argument is data and which is separator?

Beautiful is better than ugly.
Explicit is better than implicit.
..
Readability counts.
..
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
..

(The Zen of Python, by Tim Peters, AKA python -m this)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140811/26c431be/attachment.html>


More information about the Python-ideas mailing list