On Apr 7, 6:48 am, James Stroud <[EMAIL PROTECTED]> wrote: > Neal Becker wrote: > > One thing I sometimes miss, which is common in some other languages (c++), > > is idea of block scope. It would be useful to have variables that did not > > outlive their block, primarily to avoid name clashes. This also leads to > > more readable code. I wonder if this has been discussed? > > Probably, with good code, block scope would be overkill, except that I > would welcome list comprehensions to have a new scope:
Generator expressions have a new scope, and in Python 3.0 list comprehensions will have one as well (according to http://www.python.org/dev/peps/pep-0289/ ). It's a fix that might break existing code so it couldn't be introduced in "minor" versions like 2.4 and 2.5. -- http://mail.python.org/mailman/listinfo/python-list