No 1.6! (was Re: A REALLY COOL PYTHON FEATURE:)

Magnus Lie Hetland mlh at idi.ntnu.no
Sat May 13 13:48:51 EDT 2000


Aahz Maruch <aahz at netcom.com> wrote in message
news:8fh9ki$51h$1 at slb3.atl.mindspring.net...
> In article <rhgmhs07ulsob3pptd6eh4f2ag4qj911bj at 4ax.com>,
> Ben Wolfson  <rumjuggler at cryptarchy.org> wrote:
> >
> >', '.join(['foo', 'bar', 'baz'])
>
> This only works in Python 1.6, which is only released as an alpha at
> this point.  I suggest rather strongly that we avoid 1.6-specific idioms
> until 1.6 gets released, particularly in relation to FAQ-type questions.

This is indeed a bit strange IMO... If I were to join the elements of a
list I would rather ask the list to do it than some string... I.e.

   ['foo', 'bar', 'baz'].join(', ')

(...although it is the string that joins the elements in the resulting
string...)

Is this possible in 1.6? (To me, intuitively, the first version is about as
strange
as 'foo'.append(['bar', 'baz']) resulting in ['foo', 'bar', 'baz'] which is
clearly
not correct...)

Oh well - I guess I haven't thought this through properly... :)

--

  Magnus
  Lie
  Hetland





More information about the Python-list mailing list