[Python-3000] Automatically invoking str() in str.join()

Michael P. Soulier msoulier at digitaltorque.ca
Tue May 2 07:43:54 CEST 2006


On 4/30/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
> for the record, this just appeared on comp.lang.python:
>
>     hello everyone! I can't seem to find a function that combines a list of
>     items into a string with a seperator between the individual elements..
>
> which, based on the law of design based on random sampling of c.l.python,
> indicates that the current situation is not optimal.

I for one found the move to put join() as a string method _very_
unintiutive, and rather arbitrary. Lets just be different for the sake
of being different.

It makes far more sense to put the method on the data that you are
acting upon. If you're joining a list, then join() should be a list
method. This is something that Ruby does right, IMHO.

Mike
--
Michael P. Soulier <msoulier at digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein


More information about the Python-3000 mailing list