gh-125756: Document Pickler.clear_memo#125762
Conversation
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
I hope you fix the problems with clear_memo before making this doc public |
The function is public already unfortunately, the documentation is not the source of truth, the code is. |
That sounds good. We should also warn the users about potential misuse, as pointed out by @erik895 |
Sorry for the late reply, had a busy week :/ As Filipe pointed out, the function is public so there is not much we can do besides documenting its gotchas. I saw your example, though I think it's a pretty rare case to pickle multiple objects separately rather than just pickling one structure (list, dictionary, what have you..) and of course if you use How about we add this note to the docs?
|
|
Thanks @tomasr8 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Thanks @tomasr8 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
(cherry picked from commit 2542256) Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
|
GH-130231 is a backport of this pull request to the 3.12 branch. |
(cherry picked from commit 2542256) Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
|
GH-130232 is a backport of this pull request to the 3.13 branch. |
|
Well, I am not sure about backporting the documentation. Usually this is not an issue, but one of options is to deprecate this function -- in that case it is not to document it in older versions. |
Documents the public
clear_memowhich is currently undocumented. I think it makes to have it in the docs given that it is need when reusingPicklerobjects.The documentation is a copy of the docstring, but perhaps we could make it even clearer by replacing
This method is useful when re-using picklers.with something likeWhen reusing picklers, this method should be called after every call to dump?📚 Documentation preview 📚: https://cpython-previews--125762.org.readthedocs.build/