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

Nick Coghlan ncoghlan at iinet.net.au
Thu Apr 27 15:33:01 CEST 2006


Georg just added the idea of automatically invoking str() in str.join() to PEP 
3100 with a question mark on the end. I thought I'd responded when Talin first 
brought it up, but couldn't find a record of that in the archive (this is why 
one suggestion per message is a good idea ;)

I tried to implement this a couple of years ago for 2.4, and ended up giving 
up. The sticking point was the str->unicode promotion code that meant the 
implementation had to keep the un-str-ified objects around so they could be 
passed to unicode.join if it later proved necessary.

Or something like that. Whatever the details were, the code necessary to 
support it without slowing down the common case of a sequence of all strings 
was horribly contorted and ugly and the idea was (rightly) knocked on the head.

In Py3k though, that problem won't exist, as we only have to worry about 
supporting it in the function that is currently unicode.join. And fixing it 
there should be relatively straightforward.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list