Skip to content

gh-49174: document that the effect of calling gc.collect() during a collection is undefined #104699

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

Merged
merged 2 commits into from
May 20, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented May 20, 2023

Fixes #49174.

As discussed in the issue, currently gc.collect() during a collection is ignored (even if its specifies more generations than the ongoing collection). But I don't think we should enshrine this in the docs, so I propose to say it's undefined.


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

@iritkatriel iritkatriel added the needs backport to 3.11 only security fixes label May 20, 2023
@iritkatriel iritkatriel merged commit 30488fa into python:main May 20, 2023
@miss-islington
Copy link
Contributor

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-104703 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label May 20, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2023
…ng a collection is undefined (pythonGH-104699)

(cherry picked from commit 30488fa)

Co-authored-by: Irit Katriel <[email protected]>
iritkatriel added a commit that referenced this pull request May 20, 2023
…ing a collection is undefined (GH-104699) (#104703)

gh-49174: document that the effect of calling gc.collect() during a collection is undefined (GH-104699)
(cherry picked from commit 30488fa)

Co-authored-by: Irit Katriel <[email protected]>
@iritkatriel iritkatriel deleted the gc_rentry branch July 25, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gc.collect() won't always collect as expected
4 participants