[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-19 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: This is not a bug, see this thread: http://mail.python.org/pipermail/python-3000/2008-July/014328.html -- nosy: +georg.brandl resolution: - wont fix status: open - closed ___ Python tracker [EMAIL

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Carl Johnson
New submission from Carl Johnson [EMAIL PROTECTED]: Compare the following behaviors: Python 3.0a5 (r30a5:62856, May 10 2008, 10:34:28) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. def f(x): ... if x 5:

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: You seem to be suggesting that a StopIteration raised in the body of a for-loop should cause the loop to break. That isn't (as far as I know) the point of StopIteration. StopIteration is only used to break the for-loop when raised by the iterator,

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: IMO the generator expression is wrong in interpreting the StopIteration as a break. It should fail just like the list comprehension fails. -- nosy: +gvanrossum ___ Python tracker [EMAIL PROTECTED]