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

Phillip J. Eby pje at telecommunity.com
Thu Apr 27 20:15:08 CEST 2006


At 07:16 PM 4/27/2006 +0200, Barry Warsaw <barry at python.org> wrote:
>  But hey, yeah, a join() builtin would be fine if it
>took the string arg first, so that
>
>''.join(seq) == join('', seq)

And thanks to the time machine, str.join('', seq) does this already:

Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> str.join('',['a','b','c'])
'abc'

Who needs a new builtin?  :)




More information about the Python-3000 mailing list