[pypy-issue] [issue1355] Difference from CPython when extending a list with an iterable that depends on that list.

Mark Dickinson tracker at bugs.pypy.org
Fri Dec 28 18:03:30 CET 2012


New submission from Mark Dickinson <dickinsm at gmail.com>:

Taken from http://bugs.python.org/issue16791.

In CPython:

Python 2.7.3 |EPD 7.3-1 (32-bit)| (default, Apr 12 2012, 11:28:34) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "credits", "demo" or "enthought" for more information.
>>> b = [1]
>>> b += (x+1 for x in b if x < 5)
>>> b
[1, 2, 3, 4, 5]

In PyPy (version 1.9 from MacPorts):

Python 2.7.2 (341e1e3821fff77db3bb5cdb7a4851626298c44e, Jun 09 2012, 14:24:15)
[PyPy 1.9.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``'that's definitely a case of
"uh????"'''
>>>> b = [1]
>>>> b += (x+1 for x in b if x < 5)
>>>> b
[1, 2]

----------
messages: 5107
nosy: mark.dickinson, pypy-issue
priority: bug
release: 1.9
status: unread
title: Difference from CPython when extending a list with an iterable that depends on that list.

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1355>
________________________________________


More information about the pypy-issue mailing list