This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients davidhalter, gwrtheyrn, mark.dickinson, pyos, r.david.murray, rhettinger
Date 2012-12-28.16:52:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks to me as though this has nothing to do with itertools  In CPython 2.7:

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 for x in b)   # runs until Ctrl-C
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <genexpr>

In PyPy:

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: ``the world doesn't want us to
>>>> b = [1]
>>>> b += (x for x in b)  # Returns immediately.
>>>> b
[1, 1]

So it seems that PyPy is building the RHS before appending it to b.  That looks like a bug in PyPy to me.
Date User Action Args
2012-12-28 16:52:10mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, r.david.murray, gwrtheyrn, davidhalter, pyos
2012-12-28 16:52:10mark.dickinsonsetmessageid: <>
2012-12-28 16:52:10mark.dickinsonlinkissue16791 messages
2012-12-28 16:52:10mark.dickinsoncreate