On Thu, Jun 07, 2007 at 09:53:07PM +0800, Russell Keith-Magee wrote:
> 
> On 6/6/07, SmileyChris <[EMAIL PROTECTED]> wrote:
> >
> > New patch uploaded, taking into account Brian's thoughts (and fixing a
> > small bug):
> >
> > http://code.djangoproject.com/ticket/3523#comment:11
> 
> Ok; I've had a chance to look at this now. I've made a couple of minor
> modifications, mostly in docs, and to make the parser more forgiving
> on whitespace around the separating commas.
> 
> Unless there are any objections, I'm happy to check this into trunk.

Realize it's hit trunk already, but noticed an annoying potential 
gotcha- for single var in a for loop, any changes to the context stay 
put- for multiple vars, the context gets wiped.

Basically, template equiv of
for x in xrange(10):
  if x:
    print y
  y = 'foon'

behaves, while

for x,z in enumerate(xrange(10)):
  if x:
    print y
  y = 'foon'
  
would cleanse the local scope each iteration, leading to (at best) 
string if invalid, worst, pukage.

So... consistancy would be wise; which should it be?  Also, use izip 
instead of zip dang it :P
~harring

Attachment: pgp6R4h58md18.pgp
Description: PGP signature

Reply via email to