gah! I hate the new string syntax

Russell E. Owen owen at astrono.junkwashington.emu
Fri Mar 2 17:41:30 EST 2001


In article <mailman.983485923.1136.python-list at python.org>,
 "Sean 'Shaleh' Perry" <shaleh at valinux.com> wrote:

>return ";".join(["%s=%s" % (k, params[k]) for k in params.keys()])
>
>every day python seems to be moving closer to the line noise aspect of
>coding.
>

Mostly I think string methods are a great idea. One thing that annoyed 
me about python early on was the plethora of global functions that made 
more sense to me (a smalltalk lover, I admit) as methods. So overall I'm 
very pleased to see the new string methods.

However, I do agree that join is not intuitive. I believe the problem 
(at least for the way I look at it) is that join should be a list 
method, not a string method. I.e.:

  joined_string = ['a', 'b'].join(', ')

makes a lot of sense to me. The current join string method does not.

-- Russell



More information about the Python-list mailing list