gh-141510, PEP 814: Add frozendict support to pickle#144967
Conversation
Add frozendict.__getnewargs__() method.
|
@serhiy-storchaka: I addressed your review. Please review the updated PR. |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
What about frozendict views and iterators? Are they copyable/pickleable?
Are there tests for deepcopying?
I am surprised that there is no separate test_frozendict.py.
Sorry, something went wrong.
|
Oh, I don't think deepcopy of frozendict is correct. It does not work for recursive frozendict. |
Sorry, something went wrong.
|
I will try to update my PR later to address other comments.
keys, values and items views cannot be copied nor serialized by pickle. Ah, it seems like it's possible to serialize a
test_copy.test_deepcopy_frozendict() tests
Ah. It was simple to add |
Sorry, something went wrong.
You're right, the current |
Sorry, something went wrong.
|
I completed the PR to add requested tests. |
Sorry, something went wrong.
I created #145027 to fix |
Sorry, something went wrong.
I propose merging this PR first (once it will be approved), and then adding such tests to #145027 PR. |
Sorry, something went wrong.
|
Did you forget to push changes for comments which you marked resolved? |
Sorry, something went wrong.
Remove also DictKey (use Object instead).
|
Ooops, you're correct. I forgot to push my changes, but I also removed my local branch... I had to rewrite my changes. I just pushed them. I should be ok now. |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM. 👍
Sorry, something went wrong.
20b1535
into
python:main
Feb 21, 2026
|
Merged. Thanks for your great review @serhiy-storchaka, it was very useful! |
Sorry, something went wrong.
|
This broke Oddballs (i.e. text_xpickle): https://buildbot.python.org/#/builders/1868/builds/5 |
Sorry, something went wrong.
Oh, I'm not used to test_xpickle yet, I forgot about it. I wrote #145069 to fix test_xpickle. |
Sorry, something went wrong.
…4967) Add frozendict.__getnewargs__() method.
Add
frozendict.__getnewargs__()method.