Skip to content

gc.collect() docs are wrong #112502

Closed
Closed
@JelleZijlstra

Description

@JelleZijlstra

https://docs.python.org/3/library/gc.html#gc.collect says "The number of unreachable objects found is returned."

In fact, it returns (

return n + m;
) the sum of two numbers: the number of objects collected plus the number of uncollectable objects. The docs should be changed.

(What makes an object uncollectable? I didn't read too closely but it seems to have something to do with finalizers.)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions