> > Perhaps you meant that second one to be: > > (key, mydict[key] for key in mydict if key in xrange(60, 69) or key == > > 3) > > > Clearly not! Its called *list*-comprehension, not tuple-comprehension. ;) With () instead of [], it is a generator expression. http://docs.python.org/ref/genexpr.html -- http://mail.python.org/mailman/listinfo/python-list
Re: NEWBIE: Extending a For Statement.
Eduardo \"EdCrypt\" O. Padoan Mon, 21 May 2007 12:09:48 -0700
- Re: NEWBIE: Extending a For Statem... Eduardo \"EdCrypt\" O. Padoan
- Re: NEWBIE: Extending a For S... Dustan
- Re: NEWBIE: Extending a For S... Sion Arrowsmith