[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: string.join() syntax quirky?
From:       "Matt Gerrans" <mgerrans () ix ! netcom ! com>
Date:       2001-11-30 21:28:37
[Download RAW message or body]

> > I've decided to do what I should have from the beginning: always use
> > string.join.  I didn't want to because it seemed silly to import a whole
> > module for one function, and as long as I'm using Official String Methods
> > for everything else I should use them for joins too.
>
> I think this is no big deal, since the string module maps most of its
> actions including join to the string methods.
> Of course, this will slightly reduce the performance, but the module itself
> is pretty light-weight.
>
> Moreover, I think readable code is more important than performance.

Additionally, if you really hate to import string, this is easy enough to add:

def join( seq, sep=' ' ):
   return sep.join(seq)

- mfg


-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic