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

Simplify tarfile iterator #66423

Closed
serhiy-storchaka opened this issue Aug 19, 2014 · 9 comments
Closed

Simplify tarfile iterator #66423

serhiy-storchaka opened this issue Aug 19, 2014 · 9 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 22227
Nosy @rhettinger, @gustaebel, @rbtcollins, @vadmium, @serhiy-storchaka
Files
  • tarfile_tariter.diff
  • tarfile_tariter_2.diff
  • 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 2015-12-19.07:45:22.313>
    created_at = <Date 2014-08-19.08:05:55.371>
    labels = ['type-feature', 'library']
    title = 'Simplify tarfile iterator'
    updated_at = <Date 2015-12-19.07:45:22.312>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-12-19.07:45:22.312>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-12-19.07:45:22.313>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-08-19.08:05:55.371>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['36412', '40101']
    hgrepos = []
    issue_num = 22227
    keywords = ['patch']
    message_count = 9.0
    messages = ['225521', '237454', '237479', '237521', '247599', '247863', '247901', '256718', '256719']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'lars.gustaebel', 'rbcollins', 'BreamoreBoy', 'python-dev', 'martin.panter', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22227'
    versions = ['Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    TarFile iteration can be simplified by using a generator instead of iterator class. Attached patch get rid of the TarIter class and decrease sources size by 16 lines.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 19, 2014
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Mar 7, 2015

    LGTM at a quick glance. Can we have a formal patch review please.

    @vadmium
    Copy link
    Member

    vadmium commented Mar 7, 2015

    The code changes look correct and worthwhile to me. Just added some suggestions for the comments, which would become out of date.

    @serhiy-storchaka
    Copy link
    Member Author

    The patch doesn't fix a bug and doesn't add new feature. It just rewrites the code in more clear manner (in my eyes). So I leave applying or rejecting the patch on Lars.

    @rbtcollins
    Copy link
    Member

    @serhiy could you update the patch with the review feedback? Thanks. Moving back to patch review. Lars hasn't commented on this in a year, so I think we should go ahead once the patch is fixed: e.g. you should update the comments and commit it directly.

    @serhiy-storchaka
    Copy link
    Member Author

    Updated patch addresses Martin's comments. Thanks Martin.

    @rhettinger
    Copy link
    Contributor

    The patch looks good and passes tests. Go ahead and apply.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 19, 2015

    New changeset a8f24e26abc7 by Serhiy Storchaka in branch 'default':
    Issue bpo-22227: The TarFile iterator is reimplemented using generator.
    https://hg.python.org/cpython/rev/a8f24e26abc7

    @serhiy-storchaka
    Copy link
    Member Author

    Thanks Martin and Raymond for reviews.

    @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
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants