-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Comments
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()). |
per serhiy's suggestion, added two aliases. |
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. |
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(). |
Thank you for your contribution Zackery! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: