I come to praise .join, not to bury it...

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Mar 5 23:01:56 EST 2001


Alex Martelli wrote:
> 
> indeed, the string module supplies ready-made versions
> of such calls

For the time being, yes, but the intention has been
hinted at on python-dev to deprecate and eventually 
remove the string module. That worries me.

> if the string.join function had to typeswitch on the
> joiner-object to distinguish Unicode from single-byte --

I don't get this business about avoiding type switches
by dispatching on the joiner, because you still have to
typeswitch on all the OTHER strings that you're joining.
So you save one (very fast C-level) typeswitch out of 
quite a lot. Nowhere near a big enough gain to justify 
anything, to my mind.

(And if ordinary strings and Unicode strings are ever
unified, this argument will go away completely.)

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list