[Python-Dev] Re: No 1.6! (was Re: A REALLY COOL PYTHON FEATURE:)

Christian Tismer tismer@tismer.com
Sat, 13 May 2000 23:55:43 +0200


"Barry A. Warsaw" wrote:
> 
> >>>>> "CT" == Christian Tismer <tismer@tismer.com> writes:
> 
>     CT> If it came to the point where the string module had some extra
>     CT> methods which operate on two lists of string perhaps, we would
>     CT> have been totally lost, and enforcing some OO method to
>     CT> support it would be completely off the road.
> 
> The new .join() method reads a bit better if you first name the
> glue string:
> 
> space = ' '
> name = space.join(['Barry', 'Aloisius', 'Warsaw'])

Agreed.

> But yes, it does look odd when used like
> 
> ' '.join(['Christian', 'Aloisius', 'Tismer'])

I'd love that Aloisius, really. I'll ask my parents for a renaming :-)

> I still think it's nice not to have to import string "just" to get the
> join functionality, but remember of course that string.join() isn't
> going away, so you can still use this if you like it better.

Sure, and I'm glad to be able to use string methods without ugly
imports. It just came to me when my former colleague Axel met me
last time, and I showed him the 1.6 alpha with its string methods
(just looking over Fred's huge patch) that he said
"Well, quite nice. So they now go the same wrong way as Java did?
The OO pattern is dead. This example shows why."

> Alternatively, there has been talk about moving join() into the
> built-ins, but I'm not sure if the semantics of tha have been nailed
> down.

Sounds like a good alternative.

-- 
Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com