classification
Title: Add support of copy protocol to zlib compressors and decompressors
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, introom, josh.r, nadeem.vawda, serhiy.storchaka, twouters
Priority: normal Keywords: patch

Created on 2015-09-05 10:42 by serhiy.storchaka, last changed 2018-06-27 18:07 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
patch.diff introom, 2015-09-12 14:00 review
Pull Requests
URL Status Linked Edit
PR 7940 merged ZackerySpytz, 2018-06-26 22:59
Messages (6)
msg249902 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-05 10:42
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()).
msg250521 - (view) Author: shiyao.ma (introom) * Date: 2015-09-12 14:00
per serhiy's suggestion, added two aliases.
msg258706 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2016-01-20 18:12
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.
msg258709 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-01-20 18:26
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().
msg320604 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-27 18:04
New changeset d2cbfffc842b00b5257aa1c25dbcdeb456b6a249 by Serhiy Storchaka (Zackery Spytz) in branch 'master':
bpo-25007: Add copy protocol support to zlib compressors and decompressors (GH-7940)
https://github.com/python/cpython/commit/d2cbfffc842b00b5257aa1c25dbcdeb456b6a249
msg320605 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-27 18:07
Thank you for your contribution Zackery!
History
Date User Action Args
2018-06-27 18:07:13serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg320605

stage: patch review -> resolved
2018-06-27 18:04:54serhiy.storchakasetmessages: + msg320604
2018-06-26 23:01:48ZackerySpytzsetnosy: + ZackerySpytz

versions: + Python 3.8, - Python 3.6
2018-06-26 22:59:36ZackerySpytzsetstage: needs patch -> patch review
pull_requests: + pull_request7549
2016-02-07 23:35:00serhiy.storchakasetstage: needs patch
2016-01-20 18:26:26serhiy.storchakasetmessages: + msg258709
2016-01-20 18:12:56josh.rsetnosy: + josh.r
messages: + msg258706
2016-01-20 17:56:00serhiy.storchakalinkissue26166 superseder
2015-09-12 14:00:52introomsetfiles: + patch.diff

nosy: + introom
messages: + msg250521

keywords: + patch
2015-09-05 10:42:33serhiy.storchakacreate