computing with characters
Torsten Bronger
bronger at physik.rwth-aachen.de
Wed Apr 30 07:12:05 EDT 2008
Hallöchen!
Duncan Booth writes:
> Torsten Bronger <bronger 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.
I am used to it. Programming very much with unicode, I use .encode
and .decode very often and I like them. I consider en/decoding to
be an intrinsic feature of strings, but not ord(), which is an
"external", rather administrative operation on strings (and actually
not even this, but on characters) for my taste.
However, join() is really bizarre. The list rather than the
separator should be the leading actor.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger at jabber.org
(See http://ime.webhop.org for further contact info.)
More information about the Python-list
mailing list