newbe how to read in a string?

Magnus Lie Hetland mlh at idi.ntnu.no
Sat Mar 24 17:26:44 EST 2001


"Steffen Ries" <steffen.ries at sympatico.ca> wrote in message
news:m366gz44g1.fsf at gondolin.beleriand...
> "Alex Martelli" <aleaxit at yahoo.com> writes:
>
[snip]
> >
> > The 'old way' would be
> >     seq = map(float, string.split(a, ','))
> > and it still works fine of course, though I'd rather spell it
> >     seq = map(float, ','.split(a))
>
> You're (ab)using ",".join(seq) too much, it seems :-)
>
> What you wanted to say is: "seq = map(float, a.split(','))" (not
> counting the conversion problem of the first element...)
>

And I thought Alex found this syntax sooo logical and intuitive?

<wink, duck & cover>

:)

--

  Magnus Lie Hetland         http://www.hetland.org

 "Reality is that which, when you stop believing in
  it, doesn't go away."           -- Philip K. Dick






More information about the Python-list mailing list