gh-93627: Align Python implementation of pickle with C implementation of pickle#103035
gh-93627: Align Python implementation of pickle with C implementation of pickle#103035serhiy-storchaka merged 45 commits into
Conversation
… copy implementation
|
@serhiy-storchaka Will you be able to review the PR? |
Sorry, something went wrong.
Eclips4
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
…e-93627.0UgwBL.rst Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
|
Thank you for your contribution @eendebakpt. Do you mind to align also the copy module with the pickle module? It is more complex and dangerous change, because we may need to change the order of some operations which is different in copy and pickle modules. |
Sorry, something went wrong.
|
@serhiy-storchaka If aligning the copy of pickle module is still blocking #91610 I will have a look at the alignment. However, Jelle Zijlstra remarked in #103035 (comment) that the alignment might break some existing code, so we reverted these changes for this PR. @JelleZijlstra was your remark only about the |
Sorry, something went wrong.
|
@serhiy-storchaka @JelleZijlstra I created #109498 to get a feeling for the impact of aligning the behaviour of the copy module with the pickle module. Maybe more needs to be aligned, but the PR seems quite straightforward so far. |
Sorry, something went wrong.
In this PR we align the python and C implementation of
picklemodule. In this PR we have chosen to modify all implementations to follow the c implementation of pickle conventions: if a method like__reduce_ex_or__reduce__is set toNone, aTypeErroris raised.Since the behaviour of the python and c implemenations is not equal, any PR aliging the two cannot be fully backwards compatible. The impact seems limited:
__reduce_ex__attribute of a class toNone, instead of creating a method)Notes:
copymodule have been removed from the PR.