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 support of copy protocol to zlib compressors and decompressors #69195

Closed
serhiy-storchaka opened this issue Sep 5, 2015 · 6 comments
Closed
Labels
3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 25007
Nosy @Yhg1s, @serhiy-storchaka, @MojoVampire, @ZackerySpytz
PRs
  • bpo-25007: Add copy protocol support to zlib compressors and decompressors #7940
  • Files
  • patch.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 = None
    closed_at = <Date 2018-06-27.18:07:13.045>
    created_at = <Date 2015-09-05.10:42:33.328>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Add support of copy protocol to zlib compressors and decompressors'
    updated_at = <Date 2018-06-27.18:07:13.044>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-06-27.18:07:13.044>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-06-27.18:07:13.045>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-09-05.10:42:33.328>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['40446']
    hgrepos = []
    issue_num = 25007
    keywords = ['patch']
    message_count = 6.0
    messages = ['249902', '250521', '258706', '258709', '320604', '320605']
    nosy_count = 6.0
    nosy_names = ['twouters', 'nadeem.vawda', 'serhiy.storchaka', 'josh.r', 'introom', 'ZackerySpytz']
    pr_nums = ['7940']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue25007'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    zlib compressor and decompressor objects can be copied with the copy() method, but not with copy.copy(). It is easy to add support of copy protocol to them (just add __copy__() as an alias to copy()).

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Sep 5, 2015
    @introom
    Copy link
    Mannequin

    introom mannequin commented Sep 12, 2015

    per serhiy's suggestion, added two aliases.

    @MojoVampire
    Copy link
    Mannequin

    MojoVampire mannequin commented Jan 20, 2016

    Patch looks good, but incomplete. Supporting __deepcopy__ (as a simple wrapper around __copy__ that ignores the second argument) would provide complete support.

    Also, should there be tests? I mean, I assume the .copy() method itself is tested, but just to detect stupid regressions, seems like testing __copy__/deepcopy for identical behavior would be a good thing.

    @serhiy-storchaka
    Copy link
    Member Author

    I agree with Josh. Needed __deepcopy__ and tests. And I think there may be problem with sharing a docstring (that includes a signature) between copy() and __copy__(). It is better to just add separate method that calls the implementation of copy().

    @ZackerySpytz ZackerySpytz mannequin added the 3.8 (EOL) end of life label Jun 26, 2018
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset d2cbfff by Serhiy Storchaka (Zackery Spytz) in branch 'master':
    bpo-25007: Add copy protocol support to zlib compressors and decompressors (GH-7940)
    d2cbfff

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you for your contribution Zackery!

    @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
    3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant