Skip to content

gh-162407: Clarify the consistency requirement for tp_traverse - #162541

Merged
encukou merged 1 commit into
python:mainfrom
pablogsal:gh-162407-traverse-docs
Nov 26, 2026
Merged

encukou merged 1 commit into
python:mainfrom
pablogsal:gh-162407-traverse-docs

Conversation

@pablogsal

Copy link
Copy Markdown
Member

The docs say that tp_traverse can skip a reference when a lock is busy. If the collector counts that reference on its first pass, it subtracts it from the count it uses to identify garbage. If the next pass skips the reference, the collector can clear a reachable object.

The new text requires consistent visits across passes in one collection. If the object's references do not change, each traversal must visit the same references. This follows the proposal in gh-162407.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #36129808 | 📁 Comparing 4bbb916 against main (2dde49a)

  🔍 Preview build  

1 file changed
± c-api/gcsupport.html

@encukou encukou added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 26, 2026
@encukou
encukou merged commit 03c48b7 into python:main Nov 26, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 26, 2026
@encukou

encukou commented Nov 26, 2026

Copy link
Copy Markdown
Member

Thank you!

@miss-islington-app

Copy link
Copy Markdown

Thanks @pablogsal for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @pablogsal and @encukou, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 03c48b7c88958460194ca28f0a81bf9b5ad97726 3.14

@bedevere-app

bedevere-app Bot commented Nov 26, 2026

Copy link
Copy Markdown

GH-162679 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 26, 2026
encukou pushed a commit that referenced this pull request Nov 26, 2026
…GH-162541) (GH-162679)

gh-162407: Clarify the consistency requirement for tp_traverse (GH-162541)
(cherry picked from commit 03c48b7)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@encukou encukou removed the needs backport to 3.14 bugs and security fixes label Nov 26, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants