Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new tests for pickling iterators of mutable sequences #70203

Closed
serhiy-storchaka opened this issue Jan 5, 2016 · 4 comments
Closed

Add new tests for pickling iterators of mutable sequences #70203

serhiy-storchaka opened this issue Jan 5, 2016 · 4 comments
Assignees
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 26015
Nosy @rhettinger, @serhiy-storchaka
Files
  • iterators_pickle_tests.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2016-03-06.12:34:10.437>
    created_at = <Date 2016-01-05.14:47:37.168>
    labels = ['type-feature', 'tests']
    title = 'Add new tests for pickling iterators of mutable sequences'
    updated_at = <Date 2016-03-06.12:34:10.435>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2016-03-06.12:34:10.435>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-03-06.12:34:10.437>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2016-01-05.14:47:37.168>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['41507']
    hgrepos = []
    issue_num = 26015
    keywords = ['patch']
    message_count = 4.0
    messages = ['257530', '261244', '261248', '261249']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26015'
    versions = ['Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Jan 5, 2016
    @rhettinger
    Copy link
    Contributor

    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.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 6, 2016

    New changeset dfef42311c71 by Serhiy Storchaka in branch '3.5':
    Issue bpo-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 bpo-26015: Added new tests for pickling iterators of mutable sequences.
    https://hg.python.org/cpython/rev/be96b2784f73

    @serhiy-storchaka
    Copy link
    Member Author

    In 2.7 iterators are not pickleable.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants