computing with characters

cokofreedom at gmail.com cokofreedom at gmail.com
Tue May 6 07:16:55 EDT 2008


On May 6, 12:22 pm, Boris Borcic <bbor... at gmail.com> wrote:
> Duncan Booth wrote:
> > Torsten Bronger <bron... at physik.rwth-aachen.de> wrote:
>
> >> The biggest ugliness though is ",".join().  No idea why this should
> >> be better than join(list, separator=" ").  Besides, ",".join(u"x")
> >> yields an unicode object.  This is confusing (but will probably go
> >> away with Python 3).
>
> > It is only ugly because you aren't used to seeing method calls on string
> > literals.
>
> An obviously independent cause of uglyness is the inconsistency of eg
> ','.split() and ','.join()
>
> Cheers, BB

I tend to do ", ".join("%s" % e for e in item)

Is there any difference between this and str()?



More information about the Python-list mailing list