Skip to content
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

gh-125756: Document Pickler.clear_memo #125762

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Oct 20, 2024

Documents the public clear_memo which is currently undocumented. I think it makes to have it in the docs given that it is need when reusing Pickler objects.

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 like When reusing picklers, this method should be called after every call to dump?


📚 Documentation preview 📚: https://cpython-previews--125762.org.readthedocs.build/

Doc/library/pickle.rst Outdated Show resolved Hide resolved
@erik895
Copy link

erik895 commented Oct 23, 2024

I hope you fix the problems with clear_memo before making this doc public
Did you read my comment about it on the original isue?

@FFY00
Copy link
Member

FFY00 commented Oct 23, 2024

I hope you fix the problems with clear_memo before making this doc public Did you read my comment about it on the original isue?

The function is public already unfortunately, the documentation is not the source of truth, the code is.

@FFY00
Copy link
Member

FFY00 commented Oct 23, 2024

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 like When reusing picklers, this method should be called after every call to dump?

That sounds good.

We should also warn the users about potential misuse, as pointed out by @erik895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants