functional programming with map()

Greg Ewing greg at
Tue Feb 26 04:01:31 CET 2002

David Eppstein wrote:
> No side effects?  Try this:
> L = [x for x in range(10)]
> print x

Well, that's more of an "accidental" side effect.
Ideally, Guido would use his time machine to go back
and make for-loop control variables local to the
loop, so that the same could then be done for LCs.

Rumour has it that he tried to do just that, but
it turned out that some critical code in the time
machine's control software (which is written in
Python, of course) relies on side effects from
for-loop variables. So when he tried to make the
change, the time machine stopped working, preventing
him from having attempted to make the change in
the first place.

An even less substantiate rumour has it that
he is now working on translating all the time
machine software into Perl (or Ruby, depending
on who you talk to) so that this sort of problem
never happens again. Not that he will ever admit
to this, of course.

Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:

More information about the Python-list mailing list