> In my very humble opinion
> words = ["foo", "bar", "baz"]
> print words.join(" ")
> looks right and
> print " ".join(words)
> looks wrong. It will confuse people and provoke programming errors.
This is right on the mark. One of these is obvious. The other
is not. Out of couriousity, would you expect...
( "foo", "bar" ).join()
... to be a correct idiom as well?
> So I say: Implement the easy generalized join() and fiddle the
> optimization for the string-join in. Python programmers won't
> mind some hidden ugliness in the C code if they are rewarded
> with better looking Python code.
True.
C/