[Python-3000] Change to class construction?

2007-07-06 Thread Collin Winter
While experimenting with porting setuptools to py3k (as of r56155), I ran into this situation: class C: a = (4, 5) b = [c for c in range(2) if a] results in a "NameError: global name 'a' is not defined" error, while class C: a = (4, 5) b = [c for c in a] works fine. This gives the same

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Georg Brandl
Collin Winter schrieb: > While experimenting with porting setuptools to py3k (as of r56155), I > ran into this situation: > > class C: > a = (4, 5) > b = [c for c in range(2) if a] > > results in a "NameError: global name 'a' is not defined" error, while > > class C: > a = (4, 5) > b = [

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Phillip J. Eby
At 05:00 PM 7/6/2007 +0200, Georg Brandl wrote: >Collin Winter schrieb: > > While experimenting with porting setuptools to py3k (as of r56155), I > > ran into this situation: > > > > class C: > > a = (4, 5) > > b = [c for c in range(2) if a] > > > > results in a "NameError: global name 'a' is n

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Guido van Rossum
On 7/6/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 05:00 PM 7/6/2007 +0200, Georg Brandl wrote: > >Collin Winter schrieb: > > > While experimenting with porting setuptools to py3k (as of r56155), I > > > ran into this situation: > > > > > > class C: > > > a = (4, 5) > > > b = [c for c in

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Phillip J. Eby
At 12:32 AM 7/7/2007 +0200, Guido van Rossum wrote: >On 7/6/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 05:00 PM 7/6/2007 +0200, Georg Brandl wrote: > > >Collin Winter schrieb: > > > > While experimenting with porting setuptools to py3k (as of r56155), I > > > > ran into this situation: >

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Guido van Rossum
On 7/7/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 12:32 AM 7/7/2007 +0200, Guido van Rossum wrote: > >On 7/6/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > At 05:00 PM 7/6/2007 +0200, Georg Brandl wrote: > > > >Collin Winter schrieb: > > > > > While experimenting with porting setuptool

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Greg Ewing
Phillip J. Eby wrote: > This looks like a bug to me. A list comprehension's local scope > should be the locals of the enclosing code, even if its loop indexes > aren't exposed to that scope. It sounds like list comprehensions are being implemented using genexps behind the scenes now. Is this w

Re: [Python-3000] Change to class construction?

2007-07-06 Thread Georg Brandl
Greg Ewing schrieb: > Phillip J. Eby wrote: >> This looks like a bug to me. A list comprehension's local scope >> should be the locals of the enclosing code, even if its loop indexes >> aren't exposed to that scope. > > It sounds like list comprehensions are being implemented > using genexps be