[Python-Dev] Auto-str and auto-unicode in join

M.-A. Lemburg mal at egenix.com
Sun Aug 29 13:21:14 CEST 2004


Tim Peters wrote:
> If we were to do auto-str, it would be better to rewrite str.join() as
> a 1-pass algorithm, using the kind of "double allocated space as
> needed" gimmick unicode.join uses.  It would be less efficient if
> auto-promotion to Unicode turns out to be required, but it's hard to
> measure how little I care about that; it might be faster if auto-str
> and Unicode promotion aren't needed (as only 1 pass would be needed).

FWIW, I'm -1 on doing auto-conversion using str()/unicode() in
.join().

It's easy enough to make the stringification explicit in the
application. Making this automatic (with all the problems
that go with it), would only hide programming errors related
to mismatching types and create a whole new set of weird error
situations.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 29 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list