crimes in Python
Kragen Sitaker
kragen at dnaco.net
Wed Mar 8 20:31:20 EST 2000
In article <wkem9lxw9e.fsf at turangalila.harmonixmusic.com>,
Dan Schmidt <dfan at harmonixmusic.com> wrote:
>Michael Hudson <mwh21 at cam.ac.uk> writes:
>| kragen at dnaco.net (Kragen Sitaker) writes:
>| > >> sys.stderr.write(join(
>| > >> map((lambda x: 'age' + `x` + "\tsex"
>| > >> + `x` + "\trace" + `x`),
>| > >> range(1, max_suspects+1)))
>| > >> )
>|
>| Random advice: while you're learning Python, forget map exists.
>|
>| This is a particularly heinous use of it, as you're using it for
>| side-effects and ignoring the results.
>
>Isn't he passing the resulting list to join()?
Yes, but the fact that he couldn't tell what was going on is enough of
an indictment in itself. :)
I tend to think formatting is the major problem with this particular
statement. I didn't even notice I had left out the separator argument
to join().
--
<kragen at pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either. :)
More information about the Python-list
mailing list