Re: List comprehension/genexp inconsistency.

2012-03-21 Thread J. Cliff Dyer
Thanks, Ian. That does seem to explain it. The inner loop doesn't have access to the class's name space, and of course you can't fix it by referencing Foo.y explicitly, because the class isn't fully defined yet. Ultimately, we realized that the dict should be created in the __init__ method, so t

Re: List comprehension/genexp inconsistency.

2012-03-20 Thread Steve Howell
On Mar 20, 3:50 pm, Ian Kelly wrote: > On Tue, Mar 20, 2012 at 3:16 PM, Dennis Lee Bieber > > wrote: > > On Tue, 20 Mar 2012 16:23:22 -0400, "J. Cliff Dyer" > > declaimed the following in > > gmane.comp.python.general: > > >> When trying to create a class with a dual-loop generator expression in

Re: List comprehension/genexp inconsistency.

2012-03-20 Thread Ian Kelly
On Tue, Mar 20, 2012 at 3:16 PM, Dennis Lee Bieber wrote: > On Tue, 20 Mar 2012 16:23:22 -0400, "J. Cliff Dyer" > declaimed the following in > gmane.comp.python.general: > >> >> When trying to create a class with a dual-loop generator expression in a >> class definition, there is a strange scopin