string object methods vs string module functions

Emile van Sebille emile at
Wed Oct 24 01:58:38 CEST 2001

"Robin Becker" <robin at> wrote in message
news:bkEne5AzFg17EwdY at
> In a mailing to another list Steve Alexander <steve at> says
> > Various modules in Zope that used to use string functions a lot have
> > recently been converted to use string methods, and there was a noticible
> > speedup in performance as measured by benchmarks / testsuites.
> I would have thought this to be a minor speedup as the main work must
still be in C,
> but have others any thoughts/experiences on this? A function which
ReportLab uses a
> lot is join so my primitive hack test seems to bear out my intuition as
> performance seems very similar. Clearly I'm not actually testing this
properly, but
> are there any good disambiguating tests?

take from, showing ''.join and string.join() are the same:

# Join fields with optional separator
def join(words, sep = ' '):
    """join(list [,sep]) -> string

    Return a string composed of the words in list, with
    intervening occurrences of sep.  The default separator is a
    single space.

    (joinfields and join are synonymous)

    return sep.join(words)
joinfields = join


Emile van Sebille
emile at


More information about the Python-list mailing list