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.

classification
Title: Add new tests for pickling iterators of mutable sequences
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-01-05 14:47 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
iterators_pickle_tests.patch serhiy.storchaka, 2016-01-05 14:47 review
Messages (4)
msg257530 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-01-05 14:47
Proposed patch updates tests for iterators of mutable sequences. Now tested iterators in all four states (initial, running, empty and exhausted), and tested that unpickled iterator is linked with a sequence, not with an independed copy (as in case of dict iterators).

Note that there is a difference in the behavior of exhausted array iterator from other iterators. Perhaps this should be changed.
msg261244 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-03-06 11:20
These tests look fine.  I won't miss "orgit" ;-)

In test_reversed_pickle, please add the blank line before each section like you did for the other tests.

I agree that exhausted array iterator should change to match the others.  Once an iterator is exhausted, it is required to remain exhausted even if the underlying data mutates.   That rule should survive even after dumping and loading.
msg261248 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-06 12:12
New changeset dfef42311c71 by Serhiy Storchaka in branch '3.5':
Issue #26015: Added new tests for pickling iterators of mutable sequences.
https://hg.python.org/cpython/rev/dfef42311c71

New changeset be96b2784f73 by Serhiy Storchaka in branch 'default':
Issue #26015: Added new tests for pickling iterators of mutable sequences.
https://hg.python.org/cpython/rev/be96b2784f73
msg261249 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-03-06 12:34
In 2.7 iterators are not pickleable.
History
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70203
2016-03-06 12:34:10serhiy.storchakasetstatus: open -> closed
versions: - Python 2.7
messages: + msg261249

resolution: fixed
stage: patch review -> resolved
2016-03-06 12:12:26python-devsetnosy: + python-dev
messages: + msg261248
2016-03-06 11:20:19rhettingersetassignee: rhettinger -> serhiy.storchaka
messages: + msg261244
2016-03-06 07:28:11serhiy.storchakasetassignee: rhettinger

nosy: + rhettinger
2016-01-05 14:47:59serhiy.storchakalinkissue25776 dependencies
2016-01-05 14:47:37serhiy.storchakacreate