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
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 = [
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
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
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:
>
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
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
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