Loops and stuff (was Re: Python and Boehm-Demers GC, I have code.)

Greg Ewing greg.ewing at compaq.com
Thu Jul 22 20:02:55 EDT 1999


Tim Peters wrote:
> 
> I think it worked out great!  I was surprised.

I wouldn't be quite so enthusiastic. I would say that
one can learn to live with the inconvenience, and
even almost forget that it's there most of the time.
But I still feel annoyed whenever I bump up against
it.

> and maintaining state via class instances will always be more
> Pythonic.

I don't think you can assert that until a Python
with lexical scoping has been in use for a while
and we see how people prefer to write things.
My bet is that a lot of things we write now like

  b = Button(..., command = lambda self=self: self.blat(42))

would get written as

  b = Button(..., command = lambda: self.blat(42))

and we would all wonder why we didn't storm
Guido's palace years ago and force him to release
his lexical scoping code at gunpoint...

Greg




More information about the Python-list mailing list