String.join revisited (URGENT for 1.6)
Fredrik Lundh
effbot at telia.com
Mon May 29 19:52:25 EDT 2000
Courageous wrote:
>
> > > words = ["foo", "bar", "baz"]
> > > print words.join(" ")
>
> > print ( "foo", "bar" ).join(" ")
>
> I've thought about this for a bit, and it's quite clear to me that
> these idoms are the natural representation for this. Whether or
> not their implementation in python is easily/optimally acheived
> is another issue altogether, but this representation is natural
> and, IMO, right one.
...and here we go, back to the beginning of this thread...
as people have pointed out a couple of hundred times in this thread,
lists and tuples are *heterogeneous* containers. you can put *any*
kind of Python object in them, not just strings.
for other arguments against your "natural" and "righteous" solution,
check the archives.
or don't -- I'm sure your time could be better spent on hunting down
real problems in the 1.6 alphas...
</F>
More information about the Python-list
mailing list