Re: [Python-Dev] PEP 3142: Add a "while" clause to generator expressions

2009-01-20 Thread Alexey G. Shpagin
r n in range(100) if n*n < 50 or else_break()) That's to the matter of taste, I think. -- Alexey G. Shpagin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 3142: Add a "while" clause to generator expressions

2009-01-20 Thread Alexey G. Shpagin
00) while n*n < 50) > > > > May I suggest you this variant? > > > > def raiseStopIteration(): > >raise StopIteration > > > >g = (n for n in range(100) if n*n < 50 or raiseStopIteration()) -- Alexey G. Shpagin ___