[issue14845] list() != []

2020-10-30 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> out of date stage: needs patch -> resolved status: pending -> closed ___ Python tracker ___

[issue14845] list() != []

2018-05-14 Thread Cheryl Sabella
Change by Cheryl Sabella : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue14845] list() != []

2016-11-29 Thread R. David Murray
R. David Murray added the comment: OK, then this issue can be closed unless someone thinks it is worth documenting the lack of PEP 479 in 3.5 and 3.6. -- ___ Python tracker ___

[issue14845] list() != []

2016-11-29 Thread Mark Dickinson
Mark Dickinson added the comment: Wolfgang: ah, thanks, that makes more sense. I misunderstood; sorry for the noise. -- ___ Python tracker ___ __

[issue14845] list() != []

2016-11-29 Thread Wolfgang Maier
Wolfgang Maier added the comment: running with "-W always": >>> def five(x): ... for _ in range(5): ... yield x ... >>> F = five('x') >>> [next(F) for _ in range(10)] Traceback (most recent call last): File "", line 1, in File "", line 1, in StopIteration >>> list(next(F) f

[issue14845] list() != []

2016-11-29 Thread Wolfgang Maier
Wolfgang Maier added the comment: Mark, PEP479 is not fully in effect in 3.6 yet. 3.7 will raise the RuntimeError, but 3.6 still only gives a DeprecationWarning. -- ___ Python tracker _

[issue14845] list() != []

2016-11-29 Thread Mark Dickinson
Mark Dickinson added the comment: @wolma: I don't think PEP 479 is relevant here: we're not raising StopIteration inside a generator function, which is the situation that PEP 479 covers. The behaviour in 3.6 matches that originally reported: Python 3.6.0b3 (default, Nov 2 2016, 08:15:32) [GC

[issue14845] list() != []

2016-11-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue14845] list() != []

2016-11-28 Thread Wolfgang Maier
Wolfgang Maier added the comment: Isn't the difference between generator expressions and comprehensions what's dealt with by PEP479? So it seems this issue is outdated enough to deserve being closed? -- nosy: +wolma ___ Python tracker

[issue14845] list() != []

2012-05-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I will be happy to clarify the PEP when I get a chance. -- assignee: docs@python -> rhettinger priority: normal -> low ___ Python tracker __

[issue14845] list() != []

2012-05-19 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue14845] list() != []

2012-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: It has been noted elsewhere (but I cannot find it) that 1) an uncaught StopIteration raised in an expression *within* a genexp is indistinguishable from the StopIteration raised *by* the genexp upon normal termination; and 2) this makes genexps different from

[issue14845] list() != []

2012-05-17 Thread Peter Norvig
Peter Norvig added the comment: I agree with R. David Murray -- if "correct" means following the PEP 289 semantics, then list(next(F) for _ in range(10)) should be the same as def __gen(exp): for _ in exp: yield next(F) list(__gen(iter(range(10 and indeed that is the case.

[issue14845] list() != []

2012-05-17 Thread R. David Murray
R. David Murray added the comment: I think the behavior is correct. next(x) is outside the for expression in the list comprehension, but 'list(x)' is an implicit 'for x in exp'. So I believe it is the doc that needs amplification. The PEP discussion is referring specifically to the leaking

[issue14845] list() != []

2012-05-17 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Interpreter Core -None nosy: +ezio.melotti stage: -> needs patch versions: +Python 3.3 ___ Python tracker ___ _

[issue14845] list() != []

2012-05-17 Thread Peter Norvig
New submission from Peter Norvig : PEP 289 says "the semantic definition of a list comprehension in Python 3.0 will be equivalent to list(). Here is a counterexample where they differ (tested in 3.2): def five(x): "Generator yields the object x five times." for _ in range(5):