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 pitrou
Recipients Anton.Afanasyev, pitrou, rhettinger
Date 2014-04-28.19:54:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Anton, the test is wrong: it is taking a reference to the iterable object (the list), not the iterator.

To check the reference to the original iterator is released, something like this would work:

>>> import itertools, weakref
>>> it = (x for x in (1, 2))
>>> wr = weakref.ref(it)
>>> it = itertools.islice(it, 1)
>>> wr() is None
>>> list(it)
>>> wr() is None  # returns True with the patch, False without
Date User Action Args
2014-04-28 19:54:56pitrousetrecipients: + pitrou, rhettinger, Anton.Afanasyev
2014-04-28 19:54:56pitrousetmessageid: <>
2014-04-28 19:54:56pitroulinkissue21321 messages
2014-04-28 19:54:56pitroucreate