stretching list comprehensions
Simon Burton
simonb at webone.com.au
Mon Aug 11 20:04:30 EDT 2003
More information about the Python-list mailing list
Mon Aug 11 20:04:30 EDT 2003
- Previous message (by thread): stretching list comprehensions
- Next message (by thread): stretching list comprehensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 11 Aug 2003 16:44:52 -0700, David Eppstein wrote: > In article <pan.2003.08.11.23.26.39.60449 at webone.com.au>, > Simon Burton <simonb at webone.com.au> wrote: > >> >>> del y >> >>> nums = [ x+y for x in range(y) for y in range(10) ] >> Traceback (most recent call last): >> File "<stdin>", line 1, in ? >> NameError: name 'y' is not defined >> >>> >> >> Well.. Is there an inherent reason why this could/should not be made to work? >> > > It does work with the loops in the opposite order: > Aha! It seems the wrong order to my "innermost first" mind. Guess i'm changing that now. Thanks, Simon.
- Previous message (by thread): stretching list comprehensions
- Next message (by thread): stretching list comprehensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list